| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
There was a problem hiding this comment.
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.
Sorry, something went wrong.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
|
@jagadeesh545 Thank you for your contribution! We will review this and follow up on the process for adding a new feature. I noticed that an API key was exposed in the PR description (which I have now redacted). If this API key doesn't have restrictions or is attached to other Google services, please revoke it to prevent unauthorized access. |
Sorry, something went wrong.
|
Thank you @lahirumaramba. The API key is for a dummy test project and I deleted it now. |
Sorry, something went wrong.
|
@lahirumaramba Gentle reminder for the PR review. Thanks |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Discussion
Fixes #949
This pull request introduces the ability to generate out-of-band (OOB) email action links for the VERIFY_AND_CHANGE_EMAIL flow, 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
API Changes
Context Sources Used:
Manual Testing
firebase-admin-python % python Python 3.12.13 (main, Mar 7 2026, 17:21:21) [Clang 14.0.0 (clang-1400.0.29.202)] on darwin Type "help", "copyright", "credits" or "license" for more information. Cmd click to launch VS Code Native REPL >>> import firebase_admin >>> from firebase_admin import credentials, auth >>> cred = credentials.Certificate('cert.json') >>> firebase_admin.initialize_app(cred) <firebase_admin.App object at 0x108e2d9a0> >>> user = auth.create_user(email='test.old.email@example.com', password='testPassword123!', email_verified=True) >>> print("User created with UID:", user.uid) User created with UID: ORs8I3zQ5uaNawU08WATZVRpEne2 >>> link = auth.generate_verify_and_change_email_link('test.old.email@example.com', 'test.new.email@example.com') >>> print("\nClick this link to verify and change the email:") Click this link to verify and change the email: >>> print(link) https://my-test-project-e9a7b.firebaseapp.com/__/auth/action?mode=verifyAndChangeEmail&oobCode=LN6KwORzL53UN2lz_KcyC0kvTjb8gkpg2ezfX1TSZmUAAAGd9lTxSA&apiKey=redacted&lang=en >>> auth.delete_user(user.uid) >>> exit() firebase-admin-python %