Fix login2
This commit is contained in:
@@ -9,9 +9,15 @@ import { Testimonials } from './payload/collections/Testimonials'
|
||||
import { FAQ } from './payload/collections/FAQ'
|
||||
import { Media } from './payload/collections/Media'
|
||||
|
||||
const serverURL = process.env.NEXT_PUBLIC_SERVER_URL || ''
|
||||
|
||||
export default buildConfig({
|
||||
secret: process.env.PAYLOAD_SECRET || 'change-moi',
|
||||
serverURL: process.env.NEXT_PUBLIC_SERVER_URL || '',
|
||||
serverURL,
|
||||
// csrf: Payload auto-populates from serverURL when non-empty.
|
||||
// When serverURL is empty, csrf stays [] → all origins accepted (dev-safe).
|
||||
// cors: Allow the public origin to call the REST API from the browser.
|
||||
cors: serverURL ? [serverURL] : '*',
|
||||
editor: lexicalEditor(),
|
||||
routes: {
|
||||
admin: '/gestion59',
|
||||
|
||||
@@ -4,6 +4,10 @@ export const Users: CollectionConfig = {
|
||||
slug: 'users',
|
||||
auth: {
|
||||
maxLoginAttempts: 0,
|
||||
cookies: {
|
||||
secure: process.env.NODE_ENV === 'production',
|
||||
sameSite: 'Lax',
|
||||
},
|
||||
},
|
||||
admin: {
|
||||
useAsTitle: 'email',
|
||||
|
||||
Reference in New Issue
Block a user