Skip to content

fix(core): stop the preview redirect loop when exchanging a code fails - #2686

Merged
josephfusco merged 1 commit into
canaryfrom
fix/preview-code-exchange-loop
Oct 21, 2026
Merged

josephfusco merged 1 commit into
canaryfrom
fix/preview-code-exchange-loop

Conversation

@josephfusco

Copy link
Copy Markdown
Member

Related: #1287

Any rejected token exchange (a wrong FAUST_SECRET_KEY, a revoked Application Password, a user without the capability) used to send the preview back to WordPress for a new code forever; I reproduced it in the getting-started example against a local WordPress, where one preview made hundreds of /api/faust/auth/token requests in 20 seconds, and with this change it makes one round trip, logs an error and stops, while a working preview still renders.

Use of AI Tools

AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5.5
Used for: Assisting with reproducing the loop in a browser, the fix and its test.

@josephfusco josephfusco added [Type] Bug An existing feature is broken [Area] Core Issues for the @faustwp/core package labels Oct 21, 2026
@josephfusco
josephfusco marked this pull request as ready for review October 21, 2026 12:53
@josephfusco
josephfusco requested review from a team and colinmurphy as code owners October 21, 2026 12:53
@josephfusco
josephfusco merged commit 9956251 into canary Oct 21, 2026
22 of 25 checks passed
@josephfusco
josephfusco deleted the fix/preview-code-exchange-loop branch October 21, 2026 14:20
@github-actions github-actions Bot mentioned this pull request Oct 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Area] Core Issues for the @faustwp/core package [Type] Bug An existing feature is broken

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant