From 035a82281adbf1ff090b5d498e302d091d15bb98 Mon Sep 17 00:00:00 2001 From: jchaselubitz Date: Wed, 13 Dec 2023 17:12:40 +0100 Subject: [PATCH] try logging more stuff --- pages/api/auth/next-auth.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pages/api/auth/next-auth.ts b/pages/api/auth/next-auth.ts index de525e5..7664dba 100644 --- a/pages/api/auth/next-auth.ts +++ b/pages/api/auth/next-auth.ts @@ -165,8 +165,8 @@ const options: AuthOptions = { profile: any; isNewUser: boolean; }) { + console.log('In jwt callback:', { token, user, account, profile, isNewUser }); if (user) { - console.log('injwt', user, token); token.id = user.id; token.name = user.name || ''; const now = Math.floor(Date.now() / 1000); @@ -176,6 +176,8 @@ const options: AuthOptions = { return token; }, async session({ session, user, token }: { session: any; user: User; token: JWT }): Promise { + console.log('In session callback:', { session, user, token }); + session.user.id = token.id; session.encodedJwt = jwt.sign(token, process.env.NEXT_SECRET as string, { algorithm: 'HS256',