-
Notifications
You must be signed in to change notification settings - Fork 3k
feat: auth sessions #12483
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: auth sessions #12483
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.
Looks good.
Setting |
Fixes an issue introduced with 4831f66 that prevents CI from running the built code --------- Co-authored-by: Sasha <64744993+r1tsuu@users.noreply.github.com>
Needs to be retested after merging main |
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.
Looks good! We just need to edit that description before merging and be explicit about the migration as some may consider it a breaking change unless you opt out.
🚀 This is included in version v3.44.0 |
Thank you! Payload auth felt like stateless auth trying to roleplay as stateful auth for me. I'm very happy to see this change! |
guys really ?? why introducing breaking changes ? this session option should be off by default ! now i have a broken production with users not able to login, i see no migration for mongodb ?!? This is a bad practice, not everyone is reading release notes on every commit. |
id: user.id, | ||
collection: collectionConfig.slug, | ||
data: { | ||
...user, |
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.
It looks like this update happens directly without respecting the beforeChange hook on the apiKey field:
beforeChange: [encryptKey], |
This might be related to the following issue as well:
#13063
Adds full session functionality into Payload's existing local authentication strategy.
It's enabled by default, because this is a more secure pattern that we should enforce. However, we have provided an opt-out pattern for those that want to stick to stateless JWT authentication by passing
collectionConfig.auth.useSessions: false
.Todo: