Skip to content

fix: concurrent refreshes log users out #93

Open

Description

@uniqueg

Why

Each pod remembers the refresh tokens it has just used (recentRefreshSuccess in src/app/auth/api/refresh/route.ts) only in its own memory. With more than one replica, two concurrent refreshes of the same session (e.g. two tabs) can reach different pods. The pod that loses the provider's rotation race gets a 401, finds no record of the success, and deletes the session cookies, so the user is logged out.

Found in the review of the Helm chart PR (#92), which for now recommends one replica or sticky sessions.

Expected result

  • Concurrent refreshes of one session don't log the user out with several replicas: the replay handling works across replicas (shared store), or a replay 401 no longer deletes the session cookies
  • A test covers two concurrent refreshes that hit different instances
  • The replica caveat is removed from docs/operator-guide/helm-chart.md

Activity

  1. added
    priority: medium
    type: bug
    workload: hours
    status: triage
    on Nov 15, 2026
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

    priority: mediumstatus: triagetype: bugworkload: hours

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions