Fix login2
This commit is contained in:
@@ -9,9 +9,15 @@ import { Testimonials } from './payload/collections/Testimonials'
|
|||||||
import { FAQ } from './payload/collections/FAQ'
|
import { FAQ } from './payload/collections/FAQ'
|
||||||
import { Media } from './payload/collections/Media'
|
import { Media } from './payload/collections/Media'
|
||||||
|
|
||||||
|
const serverURL = process.env.NEXT_PUBLIC_SERVER_URL || ''
|
||||||
|
|
||||||
export default buildConfig({
|
export default buildConfig({
|
||||||
secret: process.env.PAYLOAD_SECRET || 'change-moi',
|
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(),
|
editor: lexicalEditor(),
|
||||||
routes: {
|
routes: {
|
||||||
admin: '/gestion59',
|
admin: '/gestion59',
|
||||||
|
|||||||
@@ -4,6 +4,10 @@ export const Users: CollectionConfig = {
|
|||||||
slug: 'users',
|
slug: 'users',
|
||||||
auth: {
|
auth: {
|
||||||
maxLoginAttempts: 0,
|
maxLoginAttempts: 0,
|
||||||
|
cookies: {
|
||||||
|
secure: process.env.NODE_ENV === 'production',
|
||||||
|
sameSite: 'Lax',
|
||||||
|
},
|
||||||
},
|
},
|
||||||
admin: {
|
admin: {
|
||||||
useAsTitle: 'email',
|
useAsTitle: 'email',
|
||||||
|
|||||||
Reference in New Issue
Block a user