Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typo on preview mode documentation #10892

Merged
merged 1 commit into from Mar 8, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/advanced-features/preview-mode.md
Expand Up @@ -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' || !res.query.slug) {
if (req.query.secret !== 'MY_SECRET_TOKEN' || !req.query.slug) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! My bad!

return res.status(401).json({ message: 'Invalid token' })
}

Expand All @@ -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
Expand Down