Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
2abbb7ab
Unverified
Commit
2abbb7ab
authored
Mar 08, 2020
by
Shu Uesugi
Committed by
GitHub
Mar 08, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Typo on preview mode documentation (#10892)
parent
178f45b2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
preview-mode.md
docs/advanced-features/preview-mode.md
+2
-2
No files found.
docs/advanced-features/preview-mode.md
View file @
2abbb7ab
...
...
@@ -75,7 +75,7 @@ Your headless CMS might allow you to include a variable in the preview URL so th
export
default
async
(
req
,
res
)
=>
{
// Check the secret and next parameters
// This secret should only be know to this API route and the CMS
if
(
req
.
query
.
secret
!==
'MY_SECRET_TOKEN'
||
!
re
s
.
query
.
slug
)
{
if
(
req
.
query
.
secret
!==
'MY_SECRET_TOKEN'
||
!
re
q
.
query
.
slug
)
{
return
res
.
status
(
401
).
json
({
message
:
'Invalid token'
})
}
...
...
@@ -88,7 +88,7 @@ export default async (req, res) => {
return
res
.
status
(
401
).
json
({
message
:
'Invalid slug'
})
}
// Enable Preview Mode
by setting the cookies
// Enable Preview Mode by setting the cookies
res
.
setPreviewData
({})
// Redirect to the path from the fetched post
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment