Skip to content

Redirect to the page the unauthenticated user tried to access after login#2079

Open
apognu wants to merge 1 commit into
versity:mainfrom
apognu:feat/redirect-to-after-login
Open

Redirect to the page the unauthenticated user tried to access after login#2079
apognu wants to merge 1 commit into
versity:mainfrom
apognu:feat/redirect-to-after-login

Conversation

@apognu
Copy link
Copy Markdown
Contributor

@apognu apognu commented Apr 22, 2026

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.html and 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.

@versity-github
Copy link
Copy Markdown
Collaborator

This won't automatically run in continuous integration without approval. A member of the Versity organization must allow it.

benmcclelland
benmcclelland previously approved these changes Apr 22, 2026
Comment thread webui/web/index.html Fixed
Comment thread webui/web/index.html Fixed
Comment thread webui/web/index.html Fixed
@benmcclelland benmcclelland self-requested a review April 22, 2026 15:58
@apognu apognu force-pushed the feat/redirect-to-after-login branch from f03ccf9 to 797accf Compare April 22, 2026 20:13
Comment thread webui/web/index.html
// 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;
Comment thread webui/web/index.html
// 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;
@apognu
Copy link
Copy Markdown
Contributor Author

apognu commented Apr 27, 2026

SAST still seems to reject this. Anything I can do to make it "safer" in its eyes?

@apognu apognu force-pushed the feat/redirect-to-after-login branch from 797accf to 6ae26b9 Compare April 27, 2026 07:31
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.

4 participants