Skip to content

[bug]: Expired session causes endless reload loop / error boundary instead of the sign-in screen #9861

Description

@yuzhiyang1

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

  1. Sign in, keep the tab open until the session expires (or invalidate the server-side session).
  2. Interact with the app (e.g. open a work items list): the request returns 401.
  3. The axios response interceptor in apps/web/core/services/api.service.ts runs window.location.replace("/?next_path=<currentPath>").
  4. The entry page "/" mounts and fires its own current-user request; that request 401s too.
  5. The interceptor runs again — now currentPath is "/", so it replaces "/" with "/?next_path=/", reloading the entry page in an endless loop. The NON_AUTHENTICATED branch of AuthenticationWrapper never 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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions