0

I've recently switched Firebase authentication from the namespaced API to the modular API, and while rebuilding my code I'm finding an issue with email verification.

When a user signs up to the site I use the sendEmailVerification function to send an email to the address they've entered, as per the code below.

Under the previous API, if they then try to access the site, the user object returned by Firebase would have a emailVerified value of false until they click on the link in the verification email. However, under the new API, once they user has been sent that verfication email, the user object returned has an emailVerified value of true, without them having to confirm.

The exception to the above is if the email address entered doesn't exist, in which case firebase still returns false, but if the email is a valid address it seems to automatically return true, enabling me to use someone else's email address to create an account.

What am I missing?

    const auth = getAuth(); 

    doSendEmailVerification = () =>
      sendEmailVerification(auth.currentUser, {
        url: "https://example-64072.web.app",
    });

User object returned:

accessToken: "bigLongDeletedString"
auth: AuthImpl {app: FirebaseAppImpl, heartbeatServiceProvider: Provider, appCheckServiceProvider: Provider, config: {…}, currentUser: _UserImpl, …}
displayName: null
email: "[email protected]"
***emailVerified: true***
isAnonymous: false
metadata: UserMetadata {createdAt: '1755609618755', lastLoginAt: '1755611635445', lastSignInTime: 'Tue, 19 Aug 2025 13:53:55 GMT', creationTime: 'Tue, 19 Aug 2025 13:20:18 GMT'}
phoneNumber: null
photoURL: null
proactiveRefresh: ProactiveRefresh {user: _UserImpl, isRunning: true, timerId: 8, errorBackoff: 30000}
providerData: [{…}]
providerId: "firebase"
reloadListener: null
reloadUserInfo: {localId: 'shorterString', email: '[email protected]', passwordHash: 'hashValue', emailVerified: true, passwordUpdatedAt: 1755609618755, …}
stsTokenManager: _StsTokenManager {…}
tenantId: null
uid: "abcdefghijklmn"
3
  • 1
    If you believe that some Firebase product isn't working as documented, you should reach out to Firebase support directly to report it. The volunteers of Stack Overflow can't really do anything to fix it for you. All we can do is help you solve specific problems with your own code. Commented Aug 19 at 14:48
  • @DougStevenson Thanks, I guess I'm looking for confirmation that I'm using their functionality correctly, or if there is something I'm missing when making the call to verify the email Commented Aug 19 at 15:26
  • If you're following the public documentation exactly as written, then you're doing it "correctly". If there's a problem with the documentation or the product implementation, that's for Firebase to work out, and you should let them know directly. Commented Aug 19 at 15:37

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.