Closed FabianClemenz closed 2 months ago
Hi @FabianClemenz 👋
Please ensure you are using next-auth@4.21.1
or earlier. In the subsequent version, they made a breaking change, where they did not expose the core
anymore!
You can see more on this in our docs: https://auth.sidebase.io/guide/authjs/quick-start
Hi @zoey-kaiser
i'm not using the AuthJS Provider but the refresh
provider. Do i also need to install it?
i'm not using the AuthJS Provider but the refresh provider. Do i also need to install it?
The server-side functions are currently only supported by the authjs provider, which is why it prompts you to install the package. The local
provider only supports client-side fetching.
We have an open PR at the moment, which adds support for server-side token and session fetching for the local provider (#855)
Until it is released, you can fetch the Token manually on the server-side using:
export default defineEventHandler(() => {
const rawToken = getCookie(event, 'auth.Token') // Or you custom cookie name
const formattedToken = `Bearer ${rawToken}`
})
If this works for you! I would close this Issue, feel free to comment in #854 where we previously discussed server-side access for the local provider 🤗
@zoey-kaiser ok i c - thanks for clarifying this!
i think i can get it working from here - thanks!
Environment
Reproduction
Reproduction link
Describe the bug
I'm using
nuxt-auth
for JWT authentication with my own backend. I wanted to create a middleware, which adds the accessToken to every request.As seen in the reproduction, i followed exactly the guide here https://auth.sidebase.io/guide/authjs/server-side/jwt-access#jwt-access but i get the error:
Additional context
No response
Logs
No response