Skip to content

Reload the page in the event of a Cloudflare challenge - #1395

Merged
fbacall merged 1 commit into
masterfrom
cf-challenge-reload
Nov 2, 2026
Merged

fbacall merged 1 commit into
masterfrom
cf-challenge-reload

Conversation

@fbacall

@fbacall fbacall commented Nov 2, 2026

Copy link
Copy Markdown
Member

Summary of changes

  • Triggers a page reload if Cloudflare sends a "Managed Challenge".

Motivation and context

The CSP was blocking such responses when they are loaded as part of a turbolinks request, e.g. if the user is applying filters, and they would just see a blank page.

Checklist

  • I have read and followed the CONTRIBUTING guide.
  • I confirm that I have the authority necessary to make this contribution on behalf of its copyright owner and agree to license it to the TeSS codebase under the BSD license.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues were identified for the change that handles Cloudflare Managed Challenges with full-page navigation.

No open issues 🎉

What changed in this PR

This PR adds full-page navigation when Cloudflare returns a Managed Challenge during a Turbolinks request, addressing blank pages caused by the application’s Content Security Policy blocking the challenge response.

Changes:

  • Checks the cf-mitigated response header when a Turbolinks request ends.
  • Navigates to the response URL, falling back to the current URL, so the challenge loads with its own headers.
File Description
app/​assets/​javascripts/​application.js Adds challenge detection and full-page navigation to the Turbolinks request-end handler.

Review effort: Balanced

@fbacall
fbacall merged commit 6a16182 into master Nov 2, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants