Middleware withAuth token is null #5120
Unanswered
rikinshah86
asked this question in
Help
Replies: 1 comment
-
I have investigated this and when I pass raw=true I get value back but not when raw=false or do not pass raw value. I did dig deeper and issue is decode function. I get payload as null. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I am following the Advanced usage configuration for wrapping middleware and keep getting null for the token when printing in the callbacks and the middleware function isn't called at all.
"next": "^12.2.0", "next-auth": "^4.10.3",
export default withAuth(middleware, { callbacks: { authorized({ token }) { console.log('Token Value'); console.log(token); return !!token; }, }, });
I am able to use session in components and get it to work but now I am trying to get login logic in middleware and its not working.
Beta Was this translation helpful? Give feedback.
All reactions