authjs-nuxt icon indicating copy to clipboard operation
authjs-nuxt copied to clipboard

getServerSession returns object, getServerToken returns null

Open hunter-isaiah96 opened this issue 1 year ago • 5 comments

Environment

Local/production

Reproduction

https://github.com/hunter-isaiah96/mylinx/tree/authjs-module

Describe the bug

I'm trying to get the JWT token in a middleware authentication function, but getServerToken returns null. I have session.strategy set to jwt. Getting the session data works fine. Any known reason why that may be?

Additional context

No response

Logs

No response

hunter-isaiah96 avatar Dec 03 '23 13:12 hunter-isaiah96

This could be a bug. Does this block you ?

Hebilicious avatar Dec 24 '23 11:12 Hebilicious

Hey, I saw that you've fixed this. When I tackle back onto this project, I will test the fix. Sorry for the late response, been working on other projects.

hunter-isaiah96 avatar Jan 03 '24 07:01 hunter-isaiah96

getServerToken also returns null in server routes

woldtwerk avatar Jan 16 '24 09:01 woldtwerk

This also might be interesting... : https://github.com/Hebilicious/authjs-nuxt/issues/160

mpgalaxy avatar Jan 25 '24 10:01 mpgalaxy

Something wrong with response.headers in getServerToken. Setting event.headers to req.headers for getToken params resolves this issue.

samnight avatar Jan 27 '24 11:01 samnight