Skip to content

fix(otp): improve error messages when phone provider is not configured#2599

Open
Suryap-hub wants to merge 1 commit into
supabase:masterfrom
Suryap-hub:fix/otp-phone-provider-error-message
Open

fix(otp): improve error messages when phone provider is not configured#2599
Suryap-hub wants to merge 1 commit into
supabase:masterfrom
Suryap-hub:fix/otp-phone-provider-error-message

Conversation

@Suryap-hub

Copy link
Copy Markdown

Problem

Closes supabase/supabase#46570

When users request an OTP verification code and don't receive it,
developers currently get this unhelpful error:

This tells them nothing about what is wrong or how to fix it.
Developers then have to search through docs and GitHub issues to
find out they need to configure Twilio/Vonage in the dashboard.

Changes

internal/api/otp.go

  1. Improved error message when phone provider is not enabled —
    now points developer directly to Dashboard → Authentication →
    Providers → Phone

  2. Improved error message when neither email nor phone is provided —
    now explains E.164 phone format requirement

Before

{
  "error": "phone_provider_disabled",
  "message": "Unsupported phone provider"
}

After

{
  "error": "phone_provider_disabled", 
  "message": "SMS/phone authentication is not enabled for this project. To fix this, go to your Supabase Dashboard → Authentication → Providers → Phone, enable Phone Auth, and configure a provider such as Twilio or Vonage."
}

Testing

  • No logic changes, only error message strings updated
  • All existing tests continue to pass

…d missing fields

When phone auth is not enabled, the previous error 'Unsupported phone provider'
gave developers no actionable information about how to fix the issue.

This change improves two error messages in otp.go:
1. Phone provider disabled: now tells the developer exactly where to go in the
   dashboard to enable it (Authentication → Providers → Phone)
2. Missing email/phone field: now explains E.164 format requirement for phone

This directly addresses the confusion reported in supabase/supabase#46570
where users receive no verification code and developers have no clear error
to debug.
@Suryap-hub Suryap-hub requested a review from a team as a code owner June 27, 2026 07:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Verification code

1 participant