auth icon indicating copy to clipboard operation
auth copied to clipboard

Unable to update user email

Open connormeany opened this issue 2 years ago • 3 comments

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

Unable to update a user's email if they have an outstanding email change request already.

To Reproduce

Steps to reproduce the behavior, please provide code snippets or a repository:

  1. Create a user using a provider other than email (i.e. signInWithOtp())
  2. Add an email to the same user using "supabase.auth.updateUser({ email: emailToVerify })"
  3. Before confirming this email, attempt the change the email of this user by calling again "supabase.auth.updateUser({ email: emailToVerify })" but with a different value of emailToVerify
  4. Will get an error "duplicate key value violates unique constraint 'identities_pkey'"

Expected behavior

If a user accidentally enters an incorrect email on their first attempt, they will want to update to the correct email. But there is no way to change the email unless the original email entered is confirmed, which may be impossible if the user made a typo. Therefore if a user enters an incorrect email on their first attempt, the only way to resolve the issue is through an admin account.

Screenshots

If applicable, add screenshots to help explain your problem.

System information

  • OS: macOS
  • Version of supabase-js: 2.25

Additional context

Add any other context about the problem here.

connormeany avatar Jun 14 '23 15:06 connormeany

Hi, I'd like to contribute to fixing this bug.

jithenms avatar Jun 17 '23 16:06 jithenms

Potential related Issues / PRs:

  • Twitter OAuth Signup Failure: This issue discusses a bug where Twitter OAuth signup fails if the user does not have an email connected to their Twitter account. The issue provides context and steps to reproduce the bug. While it may not directly address your issue, it provides insights into how Supabase handles OAuth signup and the limitations it currently has with Twitter accounts that do not have an email address connected. Understanding this limitation can help you troubleshoot your issue and explore potential workarounds.
  • Confirm Email Change with Email Template: This issue discusses the behavior of the "Confirm Email Change" feature in Supabase. It highlights that when a user changes their email, they receive two emails: one with a custom template set up for "Confirm Signup" and another with the default template. While it may not directly address your issue, it provides insights into the behavior of the email confirmation feature in Supabase. Understanding this behavior can help you troubleshoot any issues related to email confirmation in your application.

This message was generated by AI from www.triagetickets.com

matthewwong525 avatar Jun 23 '23 16:06 matthewwong525

Please fix this issue. ;(

yjgaia avatar Sep 21 '23 12:09 yjgaia