secret
This commit is contained in:
parent
195023bfa0
commit
82cf4cab55
1 changed files with 37 additions and 1 deletions
|
|
@ -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: [],
|
||||
},
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue