Files
payloadcms/test/localization/shared.ts
Jacob Fletcher afcc970e36 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.
2025-01-13 10:33:27 -05:00

22 lines
931 B
TypeScript

export const englishTitle = 'english'
export const spanishTitle = 'spanish'
export const relationEnglishTitle = 'english-relation'
export const relationSpanishTitle = 'spanish-relation'
export const relationEnglishTitle2 = `${relationEnglishTitle}2`
export const relationSpanishTitle2 = `${relationSpanishTitle}2`
export const defaultLocale = 'en'
export const spanishLocale = 'es'
export const portugueseLocale = 'pt'
export const hungarianLocale = 'hu'
// Slugs
export const localizedPostsSlug = 'localized-posts'
export const withLocalizedRelSlug = 'with-localized-relationship'
export const relationshipLocalizedSlug = 'relationship-localized'
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'