You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When redirecting from a third party application to a next app that uses setPreviewData to set preview cookies to then itself redirect to a page that wants to consume preview data in getStaticProps, no cookie will be attached to the request and therefore previewData will be empty.
A common case is a headless CMS that redirects an editor to a preview endpoint in order to review changes.
The final page in the redirect chain should always render Preview mode is On when comming from https://next-preview-mode.now.sh/api/preview regardless of the referrer or browser. Therefore the preview cookies always need to be passed in request headers.
This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.
vercel
locked as resolved and limited conversation to collaborators
Jan 30, 2022
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Bug report
Describe the bug
When redirecting from a third party application to a next app that uses
setPreviewData
to set preview cookies to then itself redirect to a page that wants to consume preview data ingetStaticProps
, no cookie will be attached to the request and thereforepreviewData
will be empty.A common case is a headless CMS that redirects an editor to a preview endpoint in order to review changes.
To Reproduce
Use an affected browser (Safari or Firefox) and
setPreviewData
Source Code:
Expected behavior
The final page in the redirect chain should always render
Preview mode is On
when comming fromhttps://next-preview-mode.now.sh/api/preview
regardless of the referrer or browser. Therefore the preview cookies always need to be passed in request headers.Beeing redirect should just work as accessing https://next-preview-mode.now.sh/api/preview directly.
System information
Additional context
Chrome, Edge and Internet Explorer work as expected.
This issue was extracted from my monologue in #11298.
The text was updated successfully, but these errors were encountered: