fix(otp): improve error messages when phone provider is not configured#2599
Open
Suryap-hub wants to merge 1 commit into
Open
fix(otp): improve error messages when phone provider is not configured#2599Suryap-hub wants to merge 1 commit into
Suryap-hub wants to merge 1 commit into
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.goImproved error message when phone provider is not enabled —
now points developer directly to Dashboard → Authentication →
Providers → Phone
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