Hebilicious / authjs-nuxt

AuthJS edge-compatible authentication Nuxt module.
https://authjs-nuxt.pages.dev/
MIT License
249 stars 28 forks source link

getServerSession returns object, getServerToken returns null #139

Open hunter-isaiah96 opened 10 months ago

hunter-isaiah96 commented 10 months ago

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

Hebilicious commented 9 months ago

This could be a bug. Does this block you ?

hunter-isaiah96 commented 9 months ago

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.

woldtwerk commented 8 months ago

getServerToken also returns null in server routes

mpgalaxy commented 8 months ago

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

samnight commented 8 months ago

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