I'm currently creating an app using Flutter.
The goal is to check to see if an account's email is verified before logging them in.
As it is now, a user signs in to their account using Auth.signInWithEmailAndPassword
At this point, Auth.isEmailVerified
returns false
Afterwards, a verification email is sent, the user then clicks on the link to verify their account and a window popup appears stating that their account is now verified.
The user tries to login again, but Auth.isEmailVerified
still returns false.
Any ideas?
This is the auth.dart
class file I'm using.
https://github.com/AndriousSolutions/auth/blob/master/lib/auth.dart
And this is my code.
child: MaterialButton(
minWidth: 200.0,
height: 42.0,
onPressed: () async {
if (_formKey.currentState.validate()) {
Auth.signInWithEmailAndPassword(
email: emailAddressController.text,
password: passwordController.text)
.then((onSuccess) {
Auth.reload();
if ((onSuccess)) {
if (Auth.isEmailVerified) {
db.createUser(
emailAddress: Auth.email,
firstName: Tools.getFirstName(Auth.displayName),
googleAccount: false);
Navigator.of(context).pushReplacementNamed(HomePage.tag);
} else {
emailVerificationDialog(context);
Auth.sendEmailVerification();
}
}
}).catchError((e) {
print(" LSAHJDSAKHDSA " + e);
});
}
},
color: ThemeSettings.RaisedButtonColor,
child: Text('Log In', style: TextStyle(color: Colors.white)),
),
Thank you so so much!!