Skip to content

Commit

Permalink
try logging more stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
jchaselubitz committed Dec 13, 2023
1 parent 39f28c8 commit 035a822
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pages/api/auth/next-auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -176,6 +176,8 @@ const options: AuthOptions = {
return token;
},
async session({ session, user, token }: { session: any; user: User; token: JWT }): Promise<Session> {
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',
Expand Down

0 comments on commit 035a822

Please sign in to comment.