Skip to content

Email change fails with generic error #655

@mattobee

Description

@mattobee

Description

Clicking "Update email" on the account page shows: "There was a problem updating your email address."

The client-side code calls supabase.auth.updateUser({ email }, { emailRedirectTo }) which returns an error, but the actual Supabase error message is sanitized away. The root cause is unknown.

Investigation leads

  1. Redirect URL allow-list — the emailRedirectTo URL (/auth/callback?next=...) may not be added to Supabase Dashboard > Authentication > URL Configuration > Redirect URLs. Deploy preview URLs need to be in the allow-list.
  2. "Secure email change" setting — if enabled in Supabase Dashboard > Authentication > Providers > Email, the flow sends confirmation to both old and new email addresses. This may affect the expected behaviour.
  3. SMTP rate limits — the built-in Supabase SMTP has strict rate limits which could cause failures.

Steps to reproduce

  1. Log in with an email/password account on a deploy preview
  2. Go to /account
  3. Enter a new email address in the "Change email" field
  4. Click "Update email"
  5. Error callout appears

Next steps

  • Add console.error('[email change]', error.message, error) temporarily to the error handler in src/pages/account.astro (line ~348) to capture the actual Supabase error
  • Check Supabase Dashboard > Authentication > URL Configuration for the redirect allow-list
  • Check Supabase Dashboard > Authentication > Providers > Email for the "Secure email change" toggle

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Not Started

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions