Skip to content

[Auth] URLs reset in non-production branches #42323

Open

Description

@r-bart

Bug report

  • I confirm this is a bug with Supabase, not with my own application.
  • I confirm I have searched the Docs, GitHub
    Discussions, and
    Discord.

Describe the bug

Email confirmation redirect URLs configured in Authentication > URL Configuration get reset
unexpectedly on preview branches. After configuring custom redirect URLs, they revert to
localhost:3000, causing confirmation emails to contain incorrect redirect links.

This issue occurs specifically on preview branches (not the main production branch).

Note: This bug is difficult to reproduce on demand. The reset happens intermittently and
I haven't been able to identify the exact trigger. It could be related to branch syncing,
deployments, or some scheduled background process.

To Reproduce

  1. Create a preview branch in Supabase Dashboard
  2. Go to Authentication > URL Configuration
  3. Set custom Site URL and Redirect URLs (e.g., https://my-preview-app.vercel.app)
  4. Save the configuration
  5. Wait some time (the reset timing is unpredictable — could be hours or days)
  6. Check the URL Configuration again — values have reverted to localhost:3000
  7. Trigger a confirmation email — the redirect URL in the email points to localhost:3000
    instead of the configured URL

Important: The exact conditions that trigger the reset are unknown. The issue has been
observed multiple times but not consistently reproducible.

Expected behavior

Once configured, the Site URL and Redirect URLs should persist indefinitely and not reset to
default values. Confirmation emails should always use the configured redirect URLs.

Screenshots

If applicable, add screenshots to help explain your problem.

System information

  • OS: macOS
  • Browser: Chrome
  • Version of supabase-js: 2.90.1
  • Version of Node.js: 22.13.1
  • Supabase Project: Preview branch (not main/production)

Additional context

  • This does NOT occur on the main production branch — only on preview branches
  • The reset seems to happen silently without any user action or notification
  • This breaks the email confirmation flow for preview/staging environments, making it
    difficult to test auth flows properly
  • Multiple occurrences have been observed, but the trigger remains unclear

Activity

  1. added
    bug
    on Jan 30, 2026
  2. changed the title [-]Authentication URLs reset in non-production branches[/-] [+][Auth] URLs reset in non-production branches[/+] on Jan 30, 2026
  3. added
    external-issue
    on Jan 30, 2026
  4. Siddx6 commented on Feb 1, 2026

    @Siddx6

    I'm experiencing this same issue. Happy to help investigate and fix it.
    Questions that might help diagnose:

    Does it happen after deployments/commits to the preview branch?
    Related to branch syncing from production?
    Any scheduled tasks that reset preview branch configs?

    I can help by:

    Monitoring when resets occur and logging the exact triggers
    Investigating the codebase if someone points me to where preview branch auth config is handled
    Submitting a PR once we identify the root cause

    Let me know where to start looking in the code!

  5. r-bart commented on Feb 1, 2026

    @r-bart
    Author

    Uhmm.

    The flow I've followed is:

    • I created a preview branch linked to the develop one in this case of my repo.
    • I go to set up the SMTP provider (resend in this case).
    • As part of the setup process, I add several redirect URLs to handle account confirmation in different environments.
    • After a while (don't know how much), they reset to default values (localhost:300 and empty URL list).

    Hope it helps.

    It's really annoying.

    Thank you!

  6. Siddx6 commented on Feb 1, 2026

    @Siddx6

    @r-bart Got it! I'll watch my preview branches and note when this happens. Can someone point me to where preview branch settings are stored in the code? Happy to help fix this

  7. added
    auth
    branching
    and removed on Jun 3, 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

    authbranchingbugexternal-issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions