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: add email as verification type for email OTPs #885

Merged
merged 2 commits into from
Jan 16, 2023

Conversation

kangmingtay
Copy link
Member

@kangmingtay kangmingtay commented Jan 4, 2023

What kind of change does this PR introduce?

  • Adds a new verification type for email OTPs called email. Currently, it's impossible to tell whether the verification type should be set to "signup" or "magiclink" when a user enters an OTP. As such, developers have to resort to trying magiclink first, then catching the error and trying with signup next.
  • Deprecate signup, magiclink types for POST /verify
  • Also remove references to the v1 OTP format since it's no longer used and any existing v1 OTPs should have expired by now.

Example request:

curl -X POST 'http://localhost:9999/verify' -H 'Content-Type: application/json' -d '{"email": "foo@example.com", "token": "123456", "type": "email"}'

@kangmingtay kangmingtay requested a review from a team as a code owner January 4, 2023 21:06
@kangmingtay kangmingtay merged commit 8d21cbc into master Jan 16, 2023
@kangmingtay kangmingtay deleted the km/fix-verify-otp branch January 16, 2023 11:07
@github-actions
Copy link
Contributor

🎉 This PR is included in version 2.40.3 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

kangmingtay added a commit to supabase/auth-js that referenced this pull request Apr 4, 2023
## What kind of change does this PR introduce?
* Update the types to include `email` as a verification type
* Related gotrue PR: supabase/auth#885
altryne added a commit to altryne/supabase that referenced this pull request May 2, 2023
… for emails `email`

Fixes supabase#14089 supabase#14089 

Specifies that `email` is the right type for OTP verification and adds `signup` and `magiclink` to be deprecated per supabase/auth#885 and supabase/auth-js#642
sh47dow pushed a commit to sh47dow/supabase that referenced this pull request May 29, 2023
… for emails `email`

Fixes supabase#14089 supabase#14089 

Specifies that `email` is the right type for OTP verification and adds `signup` and `magiclink` to be deprecated per supabase/auth#885 and supabase/auth-js#642
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants