Skip to content

Add VERIFY_AND_CHANGE_EMAIL Mail Link Support #704

@utamori

Description

@utamori

Description:

The Node.js Admin SDK has the generateVerifyAndChangeEmailLink method which allows generating action links for email address changes with verification. However, this method is missing from the Go Admin SDK.
https://firebase.google.com/docs/reference/admin/node/firebase-admin.auth.baseauth.md#baseauthgenerateverifyandchangeemaillink

https://cloud.google.com/identity-platform/docs/reference/rest/v1/accounts/sendOobCode

Current situation:

  • Node.js SDK has generateVerifyAndChangeEmailLink() (since v10.2.0)
  • Go SDK only has EmailVerificationLink() which doesn't support email address changes
  • Client SDKs generate links with mode=verifyAndChangeEmail

Use case:
When implementing email address change functionality, we need to:

  1. Send a verification link to the new email address
  2. Upon verification, update the user's email address
  3. Ensure the new email address belongs to the person requesting the change

Current workaround:
We have to implement custom token-based verification system, which adds complexity and potential security risks.

Request:
Add GenerateVerifyAndChangeEmailLink method equivalent to the Go Admin SDK to achieve feature parity with Node.js SDK.

Proposed

func (c *baseClient) EmailVerificationAndChangeLinkWithSettings( 
         ctx context.Context, email string, settings *ActionCodeSettings) (string, error) {
	return c.generateEmailActionLink(ctx, emailVerificationAndChange, email, settings)
}
type linkType string

const (
	emailLinkSignIn   linkType = "EMAIL_SIGNIN"
	emailVerification linkType = "VERIFY_EMAIL"
+	emailVerificationAndChange linkType = "VERIFY_AND_CHANGE_EMAIL"
	passwordReset     linkType = "PASSWORD_RESET"
)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions