2

I am working on an android project that includes user sign-in with email. But the problem is this. When I create test account it immediately appears in the firebase authentication section without verification. But it also sends verification mail. I want to prevent this. Because for example if somebody enters my email address and they can not click verification link because it comes to my mailbox. But when I try to sign-up with my normal mail address app crashes and it is not sending verification mail again. My goal is to prevent account creating without verification and sending verification email on second or third or whatever try.

Mehrdad Pedramfar
  • 10,941
  • 4
  • 38
  • 59
amele cono
  • 23
  • 5
  • could you explain this part _Because for example if somebody enters my email address and they can not click verification link because it comes to my mailbox. But when I try to sign-up with my normal mail address app crashes and it is not sending verification mail again_ – orimdominic Sep 09 '18 at 08:10
  • it is just a scenario. for example my mail address is sample1@gmail.com my friend know my mail address but he doesn't know password. he can enter my mail address just for prank and when i enter my mail address for registerin i can not register because he put the password. i want to prevent this – amele cono Sep 09 '18 at 11:41

1 Answers1

1

If you require only verified accounts, then you should enforce it via security rules.

"$uid": {
  ".read": "auth != null && auth.uid == $uid && auth.token.email_verified === true",
  ".write": "auth != null && auth.uid == $uid && auth.token.email_verified === true"
}

If you don't like that the account was created and discarded, you can write an offline job using the Firebase Admin SDK to clean up unverified accounts after some time.

You can't verify the email before creating the account.

bojeil
  • 29,642
  • 4
  • 69
  • 76
  • i did not say can i verify the email before creating account. at firebase console it appears immediately after registering process. i want to prevent this. i want to see them on the firebase console after verification process – amele cono Sep 15 '18 at 10:46