diff --git a/README.md b/README.md index 77f574a..05a70e8 100644 --- a/README.md +++ b/README.md @@ -240,6 +240,8 @@ The Arcane Framework provides a useful interface for performing common authentic To get started, create an authentication interface provider and register it in the Arcane authentication module: ```dart +typedef LoginInput = ({String email, String password}); + // Create an authentication interface class AuthProviderInterface implements ArcaneAuthInterface { AuthProviderInterface._internal(); @@ -287,14 +289,19 @@ class AuthProviderInterface implements ArcaneAuthInterface { } @override - Future> loginWithEmailAndPassword({ - required String email, - required String password, + Future> login({ + LoginInput? input, + Future Function()? onLoggedIn, }) async { final bool alreadyLoggedIn = await isSignedIn; if (alreadyLoggedIn) return Result.ok(null); + final credentials = input as ({String email, String password}); + + final String email = credentials.email; + final String password = credentials.password; + try { final SignInResult result = await _session.signIn( username: email,