fix(next): ensures req.locale is populated before running access control (#10533)
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.
This commit is contained in:
@@ -18,3 +18,4 @@ export const withRequiredLocalizedFields = 'localized-required'
|
||||
export const localizedSortSlug = 'localized-sort'
|
||||
export const usersSlug = 'users'
|
||||
export const blocksWithLocalizedSameName = 'blocks-same-name'
|
||||
export const cannotCreateDefaultLocale = 'cannot-create-default-locale'
|
||||
|
||||
Reference in New Issue
Block a user