I have a static AuthProvider class that centralizes all authentication.
I have the following registration code.
AuthResult newUser = await auth.createUserWithEmailAndPassword(
email: email, password: password);
if (newUser == null) {
print(
'AuthProvider: empty user is returned from createUserWithEmailAndPassword');
return false;
}
await newUser.user.sendEmailVerification();
return true;
After signing up on the app, I received a verification email, so I clicked on it. When I try to sign in next time, isEmailVerified is returning false. After some research, I think I am supposed to reload the user object as follows:
FirebaseUser user = await auth.currentUser();
await user.reload();
user = await auth.currentUser();
print('${user.isEmailVerified}');
Unfortunately, isEmailVerified is still returning false. Does anyone have any idea why this is happening?