feat: Enhance JWT callback logging in authentication
- Added additional details to the JWT callback logging, including token ID, email, name, and role for improved debugging and context during authentication. - Enhanced visibility into token state when no user is present, aiding in troubleshooting authentication issues.
This commit is contained in:
parent
a465e39a4d
commit
7a191257e3
@ -65,7 +65,11 @@ export const { handlers, auth, signIn, signOut } = NextAuth({
|
||||
} else {
|
||||
console.log("JWT callback: no user, token exists", {
|
||||
hasToken: !!token,
|
||||
tokenKeys: token ? Object.keys(token) : []
|
||||
tokenKeys: token ? Object.keys(token) : [],
|
||||
tokenId: token?.id,
|
||||
tokenEmail: token?.email,
|
||||
tokenName: token?.name,
|
||||
tokenRole: token?.role
|
||||
})
|
||||
}
|
||||
return token
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user