Skip to content

Resolve navigation to login on any user-resolution failure#121

Open
sa3eed3ed wants to merge 2 commits into
openrelik:mainfrom
sa3eed3ed:fix-login-redirect
Open

Resolve navigation to login on any user-resolution failure#121
sa3eed3ed wants to merge 2 commits into
openrelik:mainfrom
sa3eed3ed:fix-login-redirect

Conversation

@sa3eed3ed

Copy link
Copy Markdown

Summary

Visiting the app could render a permanently blank page when resolving the current user failed with anything other than an HTTP 401.

The global router guard calls setUser() and handles rejections with error.response.status === 401. For failures that carry no response — network errors, or cross-origin requests blocked before a response exists (common behind authenticating proxies that keep per-host sessions) — error.response is undefined: the handler throws, next() is never called, the navigation stays pending, and the user sees a blank screen.

Fix

Route to the login page on any user-resolution failure. The login page is the correct destination for every failure mode here, and navigation always resolves.

Testing

Full test suite passes (434 tests). Manually reproduced the blank page by making the user-resolution request fail without a response, and verified the guard now lands on the login page.

The router guard only handled errors that carried a 401 response; any
other failure (network error, blocked cross-origin request) left the
navigation pending and rendered a blank page. Route to the login page on
every resolution failure instead.
@google-cla

google-cla Bot commented Jun 2, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request updates the router's global navigation guard to redirect to the login page on any user-resolution failure, preventing a blank screen. The reviewer suggested preserving the user's original destination by passing the target path as a redirect query parameter during the redirection.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread src/router/index.js Outdated
The login page already honors the redirect query parameter; pass the
target path so users land where they were headed after signing in.
@sa3eed3ed

Copy link
Copy Markdown
Author

Good suggestion — adopted in dfe6ab6: both guard paths now pass the original destination as the redirect query parameter, which the login page already honors.

@sa3eed3ed sa3eed3ed marked this pull request as ready for review June 2, 2026 05:40
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.

1 participant