Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Ignore email and phone assertions when token hash is being verified #1097

Merged
merged 2 commits into from
Dec 12, 2024

Conversation

Dastaan2k
Copy link
Contributor

Supabase Docs

Following the above link, verifying token hash from magic link doesn't require email or phone in request body
(only 'token hash' and 'type' is required in the js example)

Pre commit state of the code threw assertion error if neither email nor phone is present in verifyOtp call preventing users to verify token hash without passing email or phone in request body ("auth/verify" endpoint called inside this function throws an error as well if email or phone is passed in request body along with token hash and type)

Hence have added a condition that will ignore the first email and phone assertion if token hash is populate

Copy link
Collaborator

@Vinzent03 Vinzent03 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution!

@Vinzent03 Vinzent03 merged commit c971786 into supabase:main Dec 12, 2024
9 checks passed
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.

3 participants