Skip to content

Commit

Permalink
added a console log to know why the prod build isn't running via http
Browse files Browse the repository at this point in the history
  • Loading branch information
noxify committed Jan 21, 2024
1 parent 7366908 commit 97bb84c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions apps/nextjs/src/app/api/auth/[provider]/callback/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ export async function GET(
const state = searchParams.get("state")
const storedState = cookies().get(`oauth_state`)?.value ?? null
if (!code || !state || !storedState || state !== storedState) {
console.error(
"token mismatch",
"Could be an old cookie value or without a secured connection (https://...).",
)

// TODO: Maybe redirect back with a generic error?
return new Response(null, {
status: 400,
})
Expand Down

0 comments on commit 97bb84c

Please sign in to comment.