again
This commit is contained in:
parent
212919fb11
commit
195023bfa0
1 changed files with 10 additions and 45 deletions
|
|
@ -34,6 +34,7 @@ export default buildConfig({
|
||||||
baseDir: path.resolve(dirname),
|
baseDir: path.resolve(dirname),
|
||||||
},
|
},
|
||||||
user: Users.slug,
|
user: Users.slug,
|
||||||
|
livePreview: {
|
||||||
url: ({ data, collectionConfig, globalConfig }) => {
|
url: ({ data, collectionConfig, globalConfig }) => {
|
||||||
const baseURL = getServerSideURL()
|
const baseURL = getServerSideURL()
|
||||||
const secret = process.env.PREVIEW_SECRET
|
const secret = process.env.PREVIEW_SECRET
|
||||||
|
|
@ -64,40 +65,4 @@ url: ({ data, collectionConfig, globalConfig }) => {
|
||||||
width: 1440,
|
width: 1440,
|
||||||
height: 900,
|
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