auth-js
auth-js copied to clipboard
Update user email that previously had no email fails
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
If a user signed up with a provider other than email and wants to later on add his email, if the change email confirmation expires it errors out and he can't resend a new confirmation email by calling updateUser again.
To Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:
- Sign up with any provider other than email
- Call
updateUser({ email: "[email protected]" }) - Change email confirmation expires, user calls
updateUser({ email: "[email protected]" })again. - Get error
duplicate key value violates unique constraint "identities_pkey"
Expected behavior
This code is checking the email field of the user before creating an identity. But it should really be checking to see if there is an email identity for that user.
Screenshots
If applicable, add screenshots to help explain your problem.
System information
- Version of supabase-js: 2.26.0
- Version of Node.js: 18
Additional context
Add any other context about the problem here.