[bug]: Expired session causes endless reload loop / error boundary instead of the sign-in screen
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 59.6k
- Forks
- 5.8k
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 49
Description
Current Behavior
When the session cookie expires while the web app is open, the user is not returned to the sign-in screen. Depending on timing they either land on an error boundary ("Looks like something went wrong") or the page keeps reloading.
Steps to Reproduce
- Sign in, keep the tab open until the session expires (or invalidate the server-side session).
- Interact with the app (e.g. open a work items list): the request returns 401.
- The axios response interceptor in
apps/web/core/services/api.service.tsrunswindow.location.replace("/?next_path=<currentPath>"). - The entry page
"/"mounts and fires its own current-user request; that request 401s too. - The interceptor runs again — now
currentPathis"/", so it replaces"/"with"/?next_path=/", reloading the entry page in an endless loop. TheNON_AUTHENTICATEDbranch ofAuthenticationWrappernever gets a stable chance to render the sign-in form.
Root Cause
The 401 interceptor redirects unconditionally, including for requests made by the entry page itself, producing a self-referential replace loop on "/".
Suggested Fix
Skip the redirect when window.location.pathname is already "/". A PR follows with the one-line guard.
Environment
- Self-hosted v1.4.2 built from source.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in apps/web/core/services/api.service.ts and trace the 401 response interceptor, then inspect the entry page and AuthenticationWrapper behavior described in the report. Reproduce the expired-session case and verify that the root path reaches the sign-in screen without an error boundary or reload loop.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- api, authentication, frontend
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 88/100