Skip to content
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

fix(next): ensures req.locale is populated before running access control #10533

Merged
merged 1 commit into from
Jan 13, 2025

Conversation

jacobsfletch
Copy link
Member

Fixes #10529. The req.locale property within collection and global access control functions does not reflect the current locale. This was because we were attaching the locale to the req only after running payload.auth, which attempts to get access control without a fully-formed req. The fix is to first authenticate the user using the executeAuthStrategies operation directly, then determine the request locale with that user, and finally get access results with the proper locale.

@jacobsfletch jacobsfletch requested a review from denolfe as a code owner January 13, 2025 04:37
@jacobsfletch jacobsfletch changed the title fix(next): ensure req.locale is populated before running access results fix(next): ensure req.locale is populated before running access control Jan 13, 2025
@jacobsfletch jacobsfletch changed the title fix(next): ensure req.locale is populated before running access control fix(next): ensures req.locale is populated before running access control Jan 13, 2025
@jacobsfletch jacobsfletch merged commit afcc970 into main Jan 13, 2025
76 checks passed
@jacobsfletch jacobsfletch deleted the fix/req-locale-access branch January 13, 2025 15:33
Copy link
Contributor

🚀 This is included in version v3.17.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

args.req.locale does not update on list view when using locale dropdown
2 participants