-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
fix: refresh auth hash before restarting streams after a long tab hide #5093
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
connortechnology
wants to merge
4
commits into
master
Choose a base branch
from
refresh-auth-on-refocus
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
36ca9aa
fix: scope the shared date range cookies to the session refs #4976
connortechnology 48db87b
fix: refresh auth hash before restarting streams after a long tab hide
connortechnology 52400cf
refactor: track credential age instead of hidden time, fold montage in
connortechnology 0ac31d9
fix: send the auth revalidation probe without a credential
connortechnology File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
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
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
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
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
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right — the description predated 52400cf, which folded montage.js in and replaced the hidden-timestamp approach (
authHiddenTooLong(hiddenAt, now)) with credential-age tracking (authIsStale(freshAt, now)). Description rewritten to match what actually shipped, including montage.js losing its bespoke refresh helper and its duplicate navBar probe.Your suppressed note about 401 vs 403 was the useful one. Chasing it turned up a real bug rather than a comment slip: the probe was going out as
zmAuth.appendTo(...), carrying the very hash it existed to replace.zm_authenticate_request()resolves a request against exactly one source — a non-emptyauth=in the URL enters theZM_AUTH_HASH_LOGINSbranch (on by default), and whengetAuthUser()rejects it the chain has already been taken, so theuserFromSession()arm below it never runs and a live session cookie authenticates as nobody.So past
ZM_AUTH_HASH_TTL— a tab hidden more than two hours on the defaults, exactly the case this PR is for — the probe was the one request guaranteed to fail, and that failure reads aslogin. The user got bounced to the login page with a perfectly good session: worse than the 403s in the log this set out to remove.0ac31d9 sends the probe bare, which also makes the failure handling mean what its comment claimed — a rejection now really is a dead session rather than a dead hash, and the comment says 401 and 403 as you noted. Four new
revalidateAuthtests cover it; reverting the probe to the credentialed form fails two of them.