faustjs icon indicating copy to clipboard operation
faustjs copied to clipboard

Preview detection via query string is too greedy and catches non WP previews

Open ccorda opened this issue 2 years ago • 1 comments

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 avatar Jun 05 '24 18:06 ccorda

@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.

theodesp avatar Jun 25 '24 15:06 theodesp