Changed settings layout + separated settings into different pages. Cleaned some code. Working on tts pages (no db/rest calls yet).

This commit is contained in:
Tom
2023-12-31 10:41:55 +00:00
parent 8eb9b9096f
commit a3352af981
20 changed files with 1083 additions and 287 deletions

View File

@ -37,12 +37,11 @@ export async function POST(req: Request) {
try {
const { id, secret } = await req.json();
const user = await fetchUserUsingAPI(req)
console.log("userrr:", user)
if (!user) {
return new NextResponse("Unauthorized", { status: 401 });
}
console.log(id, secret)
let response = null;
try {
response = await axios.post("https://id.twitch.tv/oauth2/token", {
@ -69,7 +68,7 @@ export async function POST(req: Request) {
const connection = await db.twitchConnection.create({
data: {
id,
id: id,
secret,
userId: user.id as string,
broadcasterId,