Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Enable preview mode Storyblok Next.js
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