-
Notifications
You must be signed in to change notification settings - Fork 567
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Bug report
- I confirm this is a bug with Supabase, not with my own application.
- I confirm I have searched the Docs, GitHub Discussions, and Discord.
Describe the bug
It is basically the exact same issue as #1744,
however the patch there does not cover anonymous users.
When using a send_email auth hook and using .updateUser to convert an anonymous user into an authenticated user (as described here) the email_data in the auth hook does not contain any token data.
{
token: "",
token_hash: "<my token hash>",
redirect_to: "<my redirect url>",
email_action_type: "email_change",
site_url: "<my site url>",
token_new: "",
token_hash_new: ""
}
When looking at the source code here it seems like this is because here there is a check for empty email. Since the user is anonymous the email is empty and we won't get into the ìf` block, resulting in the new otp not being set.
To Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:
- Create an anonymous user.
- Set up an email auth hook
- Try to upgrade the anonymous user to an authenticated user as described here
- There is no OTP token data in the email data.
Expected behavior
There is OTP token data in the email data.
Something like
{
token: "",
token_hash: "<my token hash>",
redirect_to: "<my redirect url>",
email_action_type: "email_change",
site_url: "<my site url>",
token_new: "123456",
token_hash_new: ""
}
System information
- supabase_flutter: ^2.9.0
- gotrue v2.173.0
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working