supabase-flutter
supabase-flutter copied to clipboard
OTP {{.Token}} works for login after account created but not for sign-up.
Bug report
- [x ] I confirm this is a bug with Supabase, not with my own application.
- [ x] I confirm I have searched the Docs, GitHub Discussions, and Discord.
Describe the bug
Using the OTP from {{.Token}} from the email template works for logins but not for signups.
To Reproduce
Steps to reproduce the behavior:
- Add {{.Token}} to email template on a project. 2. await _supabaseClient.auth.verifyOTP(email: email, token: code, type: OtpType.magiclink); (flutter version) 3. The code generates a invalid or expired error.
Expected behavior
The generated OTP should work for sign-up the same as it works for login.
Additional context
We could pass OtpType.signup, but it is unknown on how we can detect which is needed from the frontend. Handling this via error catching is redundant. It would be optimal if signup and magiclink could be combined.
https://github.com/supabase/supabase-flutter/issues/395
try to use type: "email"
try to use type: "email"
There is not a email type on the flutter implementation.
I have a work around in place that catches the error with the magiclink type and then calls the same function with sign-up but as mentioned this is overly complex and redundant.
It is in JS SDK: https://github.com/supabase/gotrue-js/blob/master/src/lib/types.ts#L595 So you probably want to open issue in this repository: https://github.com/supabase/supabase-flutter to add it.
@MichealReed Which supabase_flutter version are you using? It should exist.