Backend to allow changing email during signup - #9627
Open
nc225 wants to merge 4 commits into
Open
Conversation
Member
Web (Vercel)View the Vercel web preview for this branch. Backend
Other
|
This was referenced Aug 25, 2026
aapeliv
requested changes
Aug 26, 2026
| url=urls.invite_code_link(code=request.code), | ||
| ) | ||
|
|
||
| def SignupFlowChangeEmail( |
Member
There was a problem hiding this comment.
let's fold this into the existing signup rpc
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.
Implements the backend changes to close #9092. Frontend changes are here: #9626. This PR choose option 3 from this comment and lets users change their email at the email verification step. BE changes are necessary here because otherwise, when the user goes to make a new SignupFlow with their correct email address, the desired username is blocked by the old SignupFlow.
I tried to follow the path of our current "ChangeEmailV2" functions, which allow a logged-in user to change the account email address, but for changing signup emails I put the code in auth.py (with the other signup functions) instead of account.py where ChangeEmailV2 lives (with the other logged-in-user functions.) This new functionality also differs from ChangeEmailV2 in that passwords are not involved in changing signup emails, and we don't notify the old_email since it was never verified to begin with. Since we're changing the email in SignupFlow, this invalidates the old email_token and releases the old email to any future Signup
One question for reviewers: do we want to limit the number of times a SignupFlow can change its email address? That's not happening in the current PR but I think if we add another element to SignupFlow in auth.proto we can do that.
Testing
I added a few tests to
test_auth.pyto check the backend functionality added by this PR. To run the backend tests, I took the following steps:First I merged the frontend and backend branches into a local branch, reviewers can run:
Then, a couple steps from the frontend guide: In one terminal, start the local backend:
In a second terminal, start the local frontend:
To run the backend tests, I opened a third terminal and ran:
Frontend tests are described in the other PR.
Backend checklist
developif necessary for linear migration historyWeb frontend checklist
For maintainers