Merged
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #9286 +/- ##
==========================================
+ Coverage 82.66% 82.75% +0.08%
==========================================
Files 610 610
Lines 34598 34634 +36
Branches 3338 3353 +15
==========================================
+ Hits 28602 28660 +58
+ Misses 5649 5634 -15
+ Partials 347 340 -7 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
ffa7f0b to
971a9f3
Compare
Each auth0-js renewAuth() call creates com.auth0.auth.{state} cookies for
CSRF protection. On success they're cleaned up, but on failure they linger.
Over time, hundreds of stale cookies accumulate, exceeding browser cookie
limits and causing further auth failures — a feedback loop that logs users
out every 15-30 minutes.
Two fixes:
1. Switch from renewAuth (redirect flow) to checkSession (web_message flow).
checkSession explicitly clears its state cookies even on failure
(via transactionManager.clearTransaction), preventing future accumulation.
2. Add cleanupAuth0Cookies() to proactively remove any existing stale
com.auth0.auth.* and _com.auth0.auth.* (compat) cookies. Called on
page load, before each renewal, and on logout — clearing the backlog
for users who already have accumulated cookies.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Archaeopteryx
approved these changes
Mar 15, 2026
ui/shared/auth/AuthService.js
Outdated
| if (timeout > 0) { | ||
| // apply jitter to stagger tabs. After laptop wake (timeout === 0) | ||
| // use a small 0-5s jitter; otherwise use up to 5 minutes. | ||
| if (timeout <= 0) { |
Collaborator
There was a problem hiding this comment.
timeout is never negative because of the max(0, ... call above.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two Auth fixes in this PR:
External Taskcluster issue also needed for full fix to the TC tab issue:
The login flow (Auth0 + Taskcluster OAuth) now runs entirely in a popup window instead of opening new tabs in the main browser window.
Changes
Login.jsx: Open/loginin a popup window instead of a new tabLoginCallback.jsx: Navigate to TC auth within the same popup window; close the popup (with redirect fallback) when doneTaskclusterCallback.jsx: Always attemptwindow.close()first, fall back to redirect after 500msHow it works
/taskcluster-auth, which stores credentials and closes the popupstorageevents and updates the UIKnown limitation
Taskcluster's OAuth flow opens its dashboard (
firefox-ci-tc.services.mozilla.com) in a new tab in the main window during authorization. This is a TC-side behavior we can't control. A request has been filed with the Taskcluster team to suppress this.taskcluster/taskcluster#8357
Cookie accumulation fix (Bug 1749962)
The auth0-js library creates
com.auth0.auth.{state}cookies for each token renewal attempt. On success these are cleaned up, but on failure they linger. Over time — especially with multiple tabs — hundreds of stale cookies accumulate on the treeherder.mozilla.org domain. Once the total cookie size exceeds browser limits, it causes further renewal failures, creating a feedback loop that logs users out every 15-30 minutes.Two changes address this:
renewAuthtocheckSession: ThecheckSessionmethod uses theweb_message(postMessage) flow and explicitly cleans up its state cookies even on failure. This prevents future accumulation.cleanupAuth0Cookies()function removes all stalecom.auth0.auth.*cookies on page load, before each renewal, and on logout. This clears the backlog for users who already have accumulated cookies from before this fix.