onAuthStateChanged doesn't get called when email is verified in flutter

后端 未结 4 1084
心在旅途
心在旅途 2021-01-15 13:29

When a user signs up in my app he gets a verification e-mail. The onAuthStateChanged-listener gets called when a user gets created using createUserWithEma

4条回答
  •  南笙
    南笙 (楼主)
    2021-01-15 14:07

    Use the where Function:

    final FirebaseAuth _firebaseAuth = FirebaseAuth.instance;
    
      Stream get onAuthStateChanged {
        return _firebaseAuth.onAuthStateChanged.where((user)=> user.isEmailVerified);
      }
    

提交回复
热议问题