Email verification not working (Firebase)

hi @TIMAI2,

I have tried to implement your email verification blocks method from METRIC RAT AI2 - Registration & Login with Firebase Authentication for my project, but it failed as the email still can login even without do any verifying.
Below are the few blocks I'm trying out for the email verification.
Is it I used the wrong method? Please help :pray: :pray: :pray:
emailVerify_get-user


You may need to add something like this to your firebase rules:

{
  "rules": {
    ".read": "auth != null",
    "gmailUsers": {
      "$uid": {
        ".write": "auth.token.email_verified == true && auth.token.email.matches(/.*@gmail.com$/)"
      }
    }
  }
}

Hi @TIMAI2,

Is this one only applies to gmail domain?
How about other email domains?

And are the blocks logic used correctly?

It is just an example of a rule you could use. Modify it to suit your own requirements.

If the verification works, then blocks are ok

Authenticated users can always sign in without being verified.

Hi @TIMAI2,

I have tested out this rules into my current Firebase Realtime DB, but when i tried to login (without done email verification) after i register with new email, the MIT AI2 Companion auto closed (tried for twice).

Supposed the app will show error message user need to verify first before can login to the app.

Hi @crispbytes,
On firebase consolle, Authentication, Sign-In method did You have enable Email/password.
If you want You can try FirebaseManager Extension and try my sample that use the email verification
Best regards
Marco

hi @Marco_Perrone,

How the sendverificationemail block can check user verify their email or not ya?

Hi @crispbytes,
it is not the SendVerificationEmail block that make the check, You have to call UserDataFirebase and then in the GotUserData You can check if the email is verified or not.
Read FirebaseManager Extension where this is explained, and used in the ShoppingList sample
Best Regards
Marco

1 Like