faustjs
faustjs copied to clipboard
Preview detection via query string is too greedy and catches non WP previews
Description
We're implementing a one trust cookie manager that has preview links that look like this:
?otreset=true&otpreview=true&otgeo=
Faust is incorrectly assuming this is a WP preview link, and redirecting logged out users to the WP admin.
This is the code where this is happening: https://github.com/wpengine/faustjs/blob/canary/packages/faustwp-core/src/components/WordPressTemplate.tsx#L207
Steps to reproduce
Add ?otpreview=true to any url, e.g. https://faustjs.org/?otpreview=true
Additional context
No response
@faustwp/core Version
1.2.1
@faustwp/cli Version
1.2.1
FaustWP Plugin Version
1.2.1
WordPress Version
5.3
Additional environment details
No response
Please confirm that you have searched existing issues in the repo.
- [X] Yes
@ccorda the latest @faustwp/[email protected] version contains a fix for this issue. I'm closing this ticket but feel free to comment back if you still have any problems.