fix: clarify error message when token missing email or phone in verify endpoint#2376
Open
AKASH10513 wants to merge 3 commits intosupabase:masterfrom
Open
fix: clarify error message when token missing email or phone in verify endpoint#2376AKASH10513 wants to merge 3 commits intosupabase:masterfrom
AKASH10513 wants to merge 3 commits intosupabase:masterfrom
Conversation
📝 WalkthroughWalkthroughChanged a single validation error message in token-based verification to require either an email address or a phone number; no control flow or logic changes. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
No actionable comments were generated in the recent review. 🎉 Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@internal/api/verify.go`:
- Line 81: Update the validation error message in the return statement that
calls apierrors.NewBadRequestError (in internal/api/verify.go) to correct the
typo and improve wording: remove the stray space before "phone" and replace
"phone no" with "phone number" so the message reads clearly (e.g., "When
verifying with a token, you must provide either an email address or phone
number"). Ensure the message string used in the apierrors.NewBadRequestError
call is updated accordingly.
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.
…hone
What kind of change does this PR introduce?
Bug fix / validation improvement
What is the current behavior?
The POST /verify endpoint returns confusing validation errors when request
parameters are invalid.
Specifically:
when both token and token_hash are provided
when neither is provided
when token is provided without email or phone
when token_hash is provided along with other fields
The validation logic enforces specific parameter combinations, but the
error message does not clearly explain what is wrong, which can confuse developers.
What is the new behavior?
This change only improves the error message and does not modify the existing
validation logic or verification flow.
The change has not been tested in a running Supabase instance yet,
but it is limited to validation messaging and does not affect core logic.
Additional context
Add any other context or screenshots.
Summary by CodeRabbit