Skip to content

Commit

Permalink
implement native email/password auth
Browse files Browse the repository at this point in the history
  • Loading branch information
alextekartik committed Apr 5, 2024
1 parent aba9b3a commit 354b32a
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions auth_flutter/lib/src/auth_flutter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ class UserCredentialFlutter implements UserCredential {

@override
User get user => _user ??= wrapUser(nativeInstance.user)!;

@override
String toString() => 'UserCredentialFlutter($user)';
}

class UserFlutterImpl implements User, UserInfoWithIdToken {
Expand Down Expand Up @@ -115,6 +118,16 @@ class AuthFlutterImpl with AuthMixin implements AuthFlutter {
});
}

@override
Future<UserCredential> signInWithEmailAndPassword({
required String email,
required String password,
}) async {
var userCredential = await nativeAuth.signInWithEmailAndPassword(
email: email, password: password);
return UserCredentialFlutter(userCredential);
}

AuthFlutterImpl(this.nativeAuth) {
_listenToCurrentUser();
}
Expand Down

0 comments on commit 354b32a

Please sign in to comment.