Unable to update user email
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 42/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- go
- Domain
- authentication
Research direction
Start by reproducing the failure through supabase.auth.updateUser({ email: emailToVerify }) after an unconfirmed email change, using the duplicate identities_pkey error as the signal. Trace the email-change handling and identity constraint path; done means a pending email can be replaced with a different value without requiring confirmation of the original address.
Written by the indexing model from the issue text.
Description
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:
- Create a user using a provider other than email (i.e. signInWithOtp())
- Add an email to the same user using "supabase.auth.updateUser({ email: emailToVerify })"
- 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
- 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.
- Dominant language
- Go
- Stars
- 2.6k
- Forks
- 764
- Avg merge
- 5d 3h
- Merged PRs (30d)
- 39
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from supabase/auth
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 1/5 Under an hour Newbie friendliness 86/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Similar issues
-
optimization optimization:agents-md-curator
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
githubnext/gh-aw-cao#13143 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
blinklabs-io/bursa#904 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
yanet-platform/ipfw-go#129 ·
-
bug confmap/provider/googlesecretmanagerprovider needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
open-telemetry/opentelemetry-collector-contrib#51273 · 2 comments ·
-
bug: AI Gateway client filter lists "Unknown" twice when NULL and literal Unknown clients coexist Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 90/100