-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: rename session strategy #3144
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💯
still get CALLBACK_CREDENTIALS_JWT_ERROR , session: {
strategy: 'jwt',
}, |
Same as above, unable to get a csrf token: [next-auth][error][CALLBACK_CREDENTIALS_JWT_ERROR] |
Having the exact same problem as the two people above me. Tried both the old and new strategy way and always receiving the |
Addressed already. #3216 reported this, the fix has landed, release coming 🔜. Use the version here ttps://github.com//pull/3217#issuecomment-970646869 or |
I'm having the same issue with next-auth v4.
even after setting
|
Is there a way to use next-auth for using jwt tokens in session storage but not using it nor including a provider for user login authentication? |
BREAKING CHANGE: The `session.jwt: boolean` option has been renamed to `session.strategy: "jwt" | "database"`. The goal is to make the user's options more intuitive: 1. No adapter, `strategy: "jwt"`: This is the default. The session is saved in a cookie and never persisted anywhere. 2. With Adapter, `strategy: "database"`: If an Adapter is defined, this will be the implicit setting. No user config is needed. 3. With Adapter, `strategy: "jwt"`: The user can explicitly instruct `next-auth` to use JWT even if a database is available. This can result in faster lookups in compromise of lowered security. Read more about: https://next-auth.js.org/faq#json-web-tokens Example: ```diff session: { - jwt: true, + strategy: "jwt", } ```
This PR makes it hopefully more clear how the user can use the different session strategies.
strategy: "jwt"
: This is the default. The session is saved in a cookie and never persisted anywhere.strategy: "database"
: If an Adapter is defined, this will be the implicit setting. No user config is needed.strategy: "jwt"
: The user can explicitly instructnext-auth
to use JWT even if a database is available. This can result in faster lookups in compromise of lowered security. Read more about: https://next-auth.js.org/faq#json-web-tokensDocs: nextauthjs/docs#105