again
This commit is contained in:
parent
212919fb11
commit
195023bfa0
1 changed files with 10 additions and 45 deletions
|
|
@ -34,7 +34,8 @@ export default buildConfig({
|
|||
baseDir: path.resolve(dirname),
|
||||
},
|
||||
user: Users.slug,
|
||||
url: ({ data, collectionConfig, globalConfig }) => {
|
||||
livePreview: {
|
||||
url: ({ data, collectionConfig, globalConfig }) => {
|
||||
const baseURL = getServerSideURL()
|
||||
const secret = process.env.PREVIEW_SECRET
|
||||
|
||||
|
|
@ -42,7 +43,7 @@ url: ({ data, collectionConfig, globalConfig }) => {
|
|||
return `${baseURL}/preview/globals/${globalConfig.slug}?previewSecret=${secret}`
|
||||
}
|
||||
return `${baseURL}/preview/${collectionConfig?.slug}/${data?.slug ?? data?.id}?previewSecret=${secret}`
|
||||
},
|
||||
},
|
||||
collections: ['pages', 'posts'],
|
||||
globals: ['header', 'footer'],
|
||||
breakpoints: [
|
||||
|
|
@ -64,40 +65,4 @@ url: ({ data, collectionConfig, globalConfig }) => {
|
|||
width: 1440,
|
||||
height: 900,
|
||||
},
|
||||
],
|
||||
},
|
||||
meta: {
|
||||
titleSuffix: '- ByMackie',
|
||||
favicon: '/favicon.svg',
|
||||
ogImage: '/favicon.svg',
|
||||
},
|
||||
},
|
||||
|
||||
editor: defaultLexical,
|
||||
db: mongooseAdapter({
|
||||
url: process.env.DATABASE_URI || '',
|
||||
}),
|
||||
collections: [Pages, Posts, Media, Categories, Users],
|
||||
cors: [getServerSideURL()].filter(Boolean),
|
||||
globals: [Header, Footer],
|
||||
plugins,
|
||||
secret: process.env.PAYLOAD_SECRET!,
|
||||
sharp,
|
||||
typescript: {
|
||||
outputFile: path.resolve(dirname, 'payload-types.ts'),
|
||||
},
|
||||
jobs: {
|
||||
access: {
|
||||
run: ({ req }: { req: PayloadRequest }): boolean => {
|
||||
if (req.user) return true
|
||||
|
||||
const secret = process.env.CRON_SECRET
|
||||
if (!secret) return false
|
||||
|
||||
const authHeader = req.headers.get('authorization')
|
||||
return authHeader === `Bearer ${secret}`
|
||||
},
|
||||
},
|
||||
tasks: [],
|
||||
},
|
||||
})
|
||||
]
|
||||
Loading…
Add table
Reference in a new issue