Skip to content

withAuth returning a null token in middleware #6909

Answered by MrEmanuel
Ahmadh26 asked this question in Help
Discussion options

You must be logged in to vote

Unfortunately you can't use withAuth if you're using a session database strategy. It only works with a jwt session strategy.
I'm trying to solve the same problem and haven't found a solution for it yet..

"For the time being, the withAuth middleware only supports "jwt" as session strategy."
https://next-auth.js.org/tutorials/securing-pages-and-api-routes#nextjs-middleware

Replies: 6 comments 4 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by Ahmadh26
Comment options

You must be logged in to vote
2 replies
@MrEmanuel
Comment options

@cyrus-za
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@edgardomendoza1g
Comment options

Comment options

You must be logged in to vote
1 reply
@Ahmadh26
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
9 participants