From 354b32aef79caac8aec034799f99ed81ef069be5 Mon Sep 17 00:00:00 2001 From: Alexandre Roux Date: Fri, 5 Apr 2024 11:24:13 +0200 Subject: [PATCH] implement native email/password auth --- auth_flutter/lib/src/auth_flutter.dart | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/auth_flutter/lib/src/auth_flutter.dart b/auth_flutter/lib/src/auth_flutter.dart index d5f4977..15284f9 100644 --- a/auth_flutter/lib/src/auth_flutter.dart +++ b/auth_flutter/lib/src/auth_flutter.dart @@ -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 { @@ -115,6 +118,16 @@ class AuthFlutterImpl with AuthMixin implements AuthFlutter { }); } + @override + Future signInWithEmailAndPassword({ + required String email, + required String password, + }) async { + var userCredential = await nativeAuth.signInWithEmailAndPassword( + email: email, password: password); + return UserCredentialFlutter(userCredential); + } + AuthFlutterImpl(this.nativeAuth) { _listenToCurrentUser(); }