req.auth in NextJS middleware showing default user object #11496
Unanswered
DennisSpek
asked this question in
Help
Replies: 2 comments
-
I am not very sure, but I believe that only the |
Beta Was this translation helpful? Give feedback.
0 replies
-
Did you solve this problem?? It can be so helpful for me now |
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.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all,
I recently implemented AuthJS to handle authentication in my app. I modified both the JWT and Session callbacks within my
auth.ts
and so far, both the sessions fromawait auth()
used in my page anduseSession()
used in my client component show the updated user objects.The issue comes when I log the session used in my Middleware. The session object in my Middleware is the default one whilest I would expect all sessions to be the same objects.
My
auth.ts
is as follows:My Middleware is as follows:
The
console.log
returns the following object, which is the default object:Any reason why the object returned within my Middleware, does not include the user ID and isNewUser boolean?
Beta Was this translation helpful? Give feedback.
All reactions