comp
This commit is contained in:
@@ -164,6 +164,25 @@ class FirebaseUserRepository implements UserRepository {
|
||||
}
|
||||
}
|
||||
|
||||
// Add email and password to user authenticate with phone
|
||||
@override
|
||||
Future<bool> addEmailAndPassword(String email, String password) async {
|
||||
try {
|
||||
await _firebaseAuth.currentUser!.updateEmail(email);
|
||||
await _firebaseAuth.currentUser!.updatePassword(password);
|
||||
|
||||
return true;
|
||||
} catch (e) {
|
||||
log('xd -- Error add email and password ${e.toString()}');
|
||||
|
||||
if (e is FirebaseAuthException && e.code == 'requires-recent-login') {}
|
||||
|
||||
if (e is FirebaseAuthException && e.code == 'email-already-in-use') {}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Sign out
|
||||
@override
|
||||
Future<void> logOut() async {
|
||||
|
||||
@@ -7,6 +7,8 @@ abstract class UserRepository {
|
||||
|
||||
Future<void> signIn(String email, String password);
|
||||
|
||||
Future<bool> addEmailAndPassword(String email, String password);
|
||||
|
||||
Future<void> logOut();
|
||||
|
||||
// Future<MyUser> signUp(String name, String email, String password);
|
||||
|
||||
Reference in New Issue
Block a user