Skip to content

Commit

Permalink
chore: add logs for auth
Browse files Browse the repository at this point in the history
  • Loading branch information
0xzio committed Nov 19, 2024
1 parent 9815e1f commit 5de48bb
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions app/api/auth/[...nextauth]/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,19 @@ async function handler(req: Request, res: Response) {

const host = req.headers.get('host')

console.log(
'========host:',
host,
'process.env.NEXTAUTH_URL:',
process.env.NEXTAUTH_URL,
)

process.env.NEXTAUTH_URL =
process.env.NEXTAUTH_URL ||
(/localhost/.test(host || '') ? `http://${host}` : `https://${host}`)

console.log('===========process.env.NEXTAUTH_URL:', process.env.NEXTAUTH_URL)

return await NextAuth(req as any, res as any, {
secret: nextAuthSecret,
providers: [
Expand Down

0 comments on commit 5de48bb

Please sign in to comment.