firebase-admin-node icon indicating copy to clipboard operation
firebase-admin-node copied to clipboard

generateVerifyAndChangeEmailLink is unable to create the email action link

Open FabianTrain opened this issue 9 months ago • 4 comments

Describe your environment

  • Operating System version: _____
  • Firebase SDK version: 13.2.0
  • Firebase Product: auth
  • Node.js version: 22.14.0
  • NPM version: 10.9.2

Describe the problem

generateVerifyAndChangeEmailLink stopped working. Unfortunately I was unable trace what caused it to stop working.

When running following code to change a users email I get following error: FirebaseAuthError: INTERNAL ASSERT FAILED: Unable to create the email action link

{
  errorInfo: {
    code: 'auth/internal-error',
    message: 'INTERNAL ASSERT FAILED: Unable to create the email action link'
  },
  codePrefix: 'auth'
}

Steps to reproduce:

Create firebase auth user with password and email. Try to change the email of the user using generateVerifyAndChangeEmailLink

Relevant Code:

import admin from "firebase-admin";

const serviceAccountDev = require("../keys/developmentKey.json");

admin.initializeApp({
  credential: admin.credential.cert(serviceAccountDev),
});

const changeMail = async (email: string, newEmail: string) => {
  const changeMailLink = await admin
    .auth()
    .generateVerifyAndChangeEmailLink(email, newEmail);
  console.log("changeMailLink", changeMailLink);
};

FabianTrain avatar Apr 09 '25 10:04 FabianTrain

Same error occurs when calling generatePasswordResetLink(...)

SherpaMiguel avatar May 14 '25 15:05 SherpaMiguel

same issue for generatePasswordResetLink(). I am using nextjs and the latest node and firebase-admin versions

ifeoluwaayo avatar May 21 '25 13:05 ifeoluwaayo

I got mine working now. Ensure the email is valid and has created an account on firebase before.

ifeoluwaayo avatar May 21 '25 13:05 ifeoluwaayo

If you are still having this issue please provide us with a minimal repro so we can investigate. Thanks!

lahirumaramba avatar May 21 '25 19:05 lahirumaramba