Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

registration with email verification #2

Open
budisentosa opened this issue May 21, 2020 · 1 comment
Open

registration with email verification #2

budisentosa opened this issue May 21, 2020 · 1 comment

Comments

@budisentosa
Copy link

budisentosa commented May 21, 2020

Future<User> signInWithEmailAndPassword(String email, String password) async {

@bizz84
i am enjoing your tutorial
but i want to use email verification , if user register with email

  @override
  Future<User> signInWithEmailAndPassword(String email, String password) async {
    final authResult = await _firebaseAuth.signInWithEmailAndPassword(
        email: email, password: password);
    print('aaa');
    if (authResult.user.isEmailVerified) {
      return _userFromFirebase(authResult.user);
    } else {
      return _userFromFirebase(null);
    }
  }

  @override
  Future<User> createUserWithEmailAndPassword(
      String email, String password) async {
    final authResult = await _firebaseAuth.createUserWithEmailAndPassword(
        email: email, password: password);
    await authResult.user.sendEmailVerification();

    return _userFromFirebase(authResult.user);
  }

but, with that code, although isEmailVerified = is false
and return return _userFromFirebase(null);
but still go to home page

ty before

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants