Redirect to the page the unauthenticated user tried to access after login#2079
Open
apognu wants to merge 1 commit into
Open
Redirect to the page the unauthenticated user tried to access after login#2079apognu wants to merge 1 commit into
apognu wants to merge 1 commit into
Conversation
Collaborator
|
This won't automatically run in continuous integration without approval. A member of the Versity organization must allow it. |
benmcclelland
previously approved these changes
Apr 22, 2026
f03ccf9 to
797accf
Compare
| // Validate same origin and against an explicit page allowlist. | ||
| // Using URL() means javascript: URIs resolve with origin "null" and are rejected. | ||
| if (url.origin === window.location.origin && ALLOWED_PAGES.includes(url.pathname)) { | ||
| window.location.href = previousLocation; |
| // Validate same origin and against an explicit page allowlist. | ||
| // Using URL() means javascript: URIs resolve with origin "null" and are rejected. | ||
| if (url.origin === window.location.origin && ALLOWED_PAGES.includes(url.pathname)) { | ||
| window.location.href = previousLocation; |
Contributor
Author
|
SAST still seems to reject this. Anything I can do to make it "safer" in its eyes? |
797accf to
6ae26b9
Compare
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.
If an unauthenticated user tries to access a specific page (for example, a specific prefix in a bucket), they were redirected to the login page, and presented with either the dashboard or the explorer root after login.
This PR adds the page they tried to access before the login redirect to the URL hash on
index.htmland rediects to it after login.On top of UX improvement, this adds the possibility to provide direct links to buckets or prefixes that work regardless of whether the user already has a "session" or not.