clearPreviewData()
doesn't work with custom path
#39853
Labels
bug
Issue was opened via the bug report template.
clearPreviewData()
doesn't work with custom path
#39853
Verify canary release
Provide environment information
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 21.3.0: Wed Jan 5 21:37:58 PST 2022; root:xnu-8019.80.24~20/RELEASE_ARM64_T8101
Binaries:
Node: 16.14.2
npm: 8.6.0
Yarn: 1.22.18
pnpm: N/A
Relevant packages:
next: 12.2.5
eslint-config-next: 12.0.4
react: 17.0.2
react-dom: 17.0.2
What browser are you using? (if relevant)
104.0.5112.101
How are you deploying your application? (if relevant)
No response
Describe the Bug
Custom path option for preview mode was added in #38313 however the
clearPreviewData
method was not updated. Currently, it does not clear the preview mode on custom paths (as it sets the expiry cookie on/
by default, instead of a custom path specified withres.setPreviewData
)A potential fix is to allow
res.clearPreviewData
to accept a path argument on which to expire the Next.js preview mode cookies.Expected Behavior
res.clearPreviewData()
should work on custom paths tooLink to reproduction
https://codedamn.com/playground/mLua3PAdbeGQLmJZVS5cf
To Reproduce
The text was updated successfully, but these errors were encountered: