feat(auth): Add support for VERIFY_AND_CHANGE_EMAIL out-of-band links#950
Open
jagadeesh545 wants to merge 3 commits intofirebase:mainfrom
Open
feat(auth): Add support for VERIFY_AND_CHANGE_EMAIL out-of-band links#950jagadeesh545 wants to merge 3 commits intofirebase:mainfrom
jagadeesh545 wants to merge 3 commits intofirebase:mainfrom
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces the generate_verify_and_change_email_link functionality to the Firebase Admin Python SDK, enabling the generation of links for email verification and change flows. The changes span the Auth client, user management logic, and utility constants, and are accompanied by extensive unit and integration tests. Reviewer feedback includes a suggestion to improve the robustness of the internal link generation method by validating that the new_email parameter is used exclusively with the appropriate action type, as well as a request for PEP 8 compliant formatting in the test suite.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
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.
Discussion
Fixes #949
This pull request introduces the ability to generate out-of-band (OOB) email action links for the
VERIFY_AND_CHANGE_EMAILflow, mirroring the Node.js SDK feature. This enables a secure "change email" flow where the verification link is sent to the current address, protecting accounts from unauthorized email changes during hijacked sessions.Testing
tests/test_user_mgt.pyandtests/test_tenant_mgt.pyto verify the request payload mapsnew_emailcorrectly and validates required parameters.integration/test_auth.pyandintegration/test_tenant_mgt.pyto ensure end-to-end functionality against a real Firebase project.API Changes
'VERIFY_AND_CHANGE_EMAIL'toVALID_EMAIL_ACTION_TYPES.generate_verify_and_change_email_link(email, new_email, action_code_settings=None, app=None)to the publicauthmodule.Clientinstance.UserManager.generate_email_action_linkto acceptnew_email.Context Sources Used:
Manual Testing