-
Notifications
You must be signed in to change notification settings - Fork 267
Description
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:
- Send a verification link to the new email address
- Upon verification, update the user's email address
- 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"
)