separate error handling for account creation and profile update in s… - #340
Merged
Nitya-003 merged 1 commit intoJul 24, 2026
Conversation
|
@khushboo-khatoon is attempting to deploy a commit to the Nitya Gosain's projects Team on Vercel. A member of the Team first needs to authorize it. |
Contributor
Author
|
hey @Nitya-003 , |
Nitya-003
approved these changes
Jul 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #338
Description
Previously,
createUserWithEmailAndPasswordandupdateProfilewere both wrapped inside a singletry/catchblock insignupform.tsx. This meant that if account creation succeeded butupdateProfilefailed (e.g. due to a network blip), the user was shown a generic "Signup failed" message — even though their account was actually created successfully in Firebase Auth.This caused confusion: users would think signup failed and retry with the same email, only to hit an
auth/email-already-in-useerror, without realizing an account already existed for them.Changes
try/catchinto two separate blocks:createUserWithEmailAndPassword— a failure here is a real signup failure, so the user sees the "Signup failed" toast/message and the function returns early.updateProfile— a failure here is now non-blocking. It's logged viaconsole.errorfor debugging, but the user is not shown an error, since their account was already created successfully.router.push("/")) now run after both steps, so the user only ever sees a real failure when the account genuinely wasn't created.Before
After
Impact
Users will no longer see a false "Signup failed" message when their account was actually created successfully, preventing confusion and duplicate signup attempts.
Checklist