Resolve navigation to login on any user-resolution failure#121
Resolve navigation to login on any user-resolution failure#121sa3eed3ed wants to merge 2 commits into
Conversation
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.
|
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. |
There was a problem hiding this comment.
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.
The login page already honors the redirect query parameter; pass the target path so users land where they were headed after signing in.
|
Good suggestion — adopted in dfe6ab6: both guard paths now pass the original destination as the |
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 witherror.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.responseis 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.