Odin
Odin

Reputation: 682

Firebase email verification happens automatically even before clicking the link

I've been facing a weird behaviour while implementing the email verification through Firebase. After creating an account through an Android app, I send an email verification for the user.

The email is being sent properly but it gets verified automatically even before clicking on the link (as in firebaseAuth.currentUser.isEmailVerified will return true after that). If the user presses on the link afterwards, it will say:

Your request to verify your email has expired or the link has already been used

This only happens with custom domains though. For example if the user uses a gmail account, everything goes normally.

Some more info

The credentials responsible for the email verification is restricted for HTTP referrers with https://{APP-ID}.firebaseapp.com for the APIs Firebase Dynamic Links API and Identity Toolkit API

Any ideas on what might be happening?

Upvotes: 4

Views: 806

Answers (1)

Reid Moffat
Reid Moffat

Reputation: 361

Did you previously make an account with that email, verify the email, then delete the account? I had this same issue, it seems like firebase remembers email verification by email address, not by account.

This is likely an issue with firebase (albeit a rarer edge case in practical use), but if you're just doing testing, try using another email.

UPDATE: See comment below, it appears to be domain-related

Upvotes: 2

Related Questions