Skip to content

Infinite loop when navigating back from the TOTP Verification screen #60

Description

@damnsamn

Describe the Bug

Looks to be a similar issue to #35. When you log in and hit TOTP verification, if you hit back in your browser, you get a solid white screen while your browser loops requests to /admin/verify-totp/?back=%2Fadmin%2Flogin%2F. Mixture of 200 and 308 responses between RSC payloads and the main GETs

Link to the code that reproduces this issue

The app gets stuck in a redirect loop to /admin/verify-totp?back=%2Fadmin%2Flogin%2F

Reproduction Steps

Log in to the admin panel.

Complete TOTP setup.

Logout and log back in.

Reach the /admin/verify-totp screen.

Navigate "back" via your browser, and observe the infinite loop

Environment Info

Binaries:
  Node: 25.5.0
  npm: 11.8.0
  Yarn: 1.22.22
  pnpm: 10.17.1
Relevant Packages:
  payload: 3.77.0
  next: 16.1.6
  @payloadcms/db-mongodb: 3.77.0
  @payloadcms/email-resend: 3.77.0
  @payloadcms/graphql: 3.77.0
  @payloadcms/live-preview: 3.77.0
  @payloadcms/live-preview-react: 3.77.0
  @payloadcms/next/utilities: 3.77.0
  @payloadcms/plugin-cloud-storage: 3.77.0
  @payloadcms/plugin-form-builder: 3.77.0
  @payloadcms/richtext-lexical: 3.77.0
  @payloadcms/richtext-slate: 3.77.0
  @payloadcms/translations: 3.77.0
  @payloadcms/ui/shared: 3.77.0
  react: 19.2.4
  react-dom: 19.2.4
Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 24.0.0: Mon Aug 12 20:52:31 PDT 2024; root:xnu-11215.1.10~2/RELEASE_ARM64_T6030
  Available memory (MB): 18432
  Available CPU cores: 12

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions