This commit is contained in:
Mackie 2026-06-01 13:46:10 +08:00
parent 195023bfa0
commit 82cf4cab55

View file

@ -65,4 +65,40 @@ export default buildConfig({
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: [],
},
})