Created
August 12, 2020 13:25
-
-
Save onefriendaday/1763d24a3eb11edea0adb38ddd2a53a2 to your computer and use it in GitHub Desktop.
Enable preview mode Storyblok Next.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default (req, res) => { | |
// ... | |
res.setPreviewData({}) | |
const previous = res.getHeader('Set-Cookie') | |
previous.forEach((cookie, index) => { | |
previous[index] = cookie.replace('SameSite=Lax', 'SameSite=None') | |
}) | |
res.setHeader(`Set-Cookie`, previous) | |
res.end("Preview mode enabled") | |
// ... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment