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

@ -12,7 +12,6 @@ export async function GET(req: Request) {
}
})
console.log("API USER:", key)
if (!key) {
return new NextResponse("Forbidden", { status: 403 });
}
@ -35,7 +34,6 @@ export async function GET(req: Request) {
if (expires_in > 3600)
return new NextResponse("", { status: 201 });
} catch (error) {
console.log("Oudated Twitch token.")
}
// Post to https://id.twitch.tv/oauth2/token
@ -48,9 +46,9 @@ export async function GET(req: Request) {
// Fetch values from token.
const { access_token, expires_in, refresh_token, token_type } = token
console.log("AT", access_token)
console.log("RT", refresh_token)
console.log("TT", token_type)
// console.log("AT", access_token)
// console.log("RT", refresh_token)
// console.log("TT", token_type)
if (!access_token || !refresh_token || token_type !== "bearer") {
return new NextResponse("Unauthorized", { status: 401 });