secret
This commit is contained in:
parent
5fa35146ca
commit
212919fb11
1 changed files with 9 additions and 8 deletions
|
|
@ -34,13 +34,14 @@ 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
|
||||||
|
|
||||||
if (globalConfig) {
|
if (globalConfig) {
|
||||||
return `${baseURL}/preview/globals/${globalConfig.slug}`
|
return `${baseURL}/preview/globals/${globalConfig.slug}?previewSecret=${secret}`
|
||||||
}
|
}
|
||||||
return `${baseURL}/preview/${collectionConfig?.slug}/${data?.slug ?? data?.id}`
|
return `${baseURL}/preview/${collectionConfig?.slug}/${data?.slug ?? data?.id}?previewSecret=${secret}`
|
||||||
},
|
},
|
||||||
collections: ['pages', 'posts'],
|
collections: ['pages', 'posts'],
|
||||||
globals: ['header', 'footer'],
|
globals: ['header', 'footer'],
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue