- Added the ability to use a generic type for the login method in ArcaneAuthenticationService
- Added the ability to reset the ArcaneAuthenticationService, which will unregister the current interface and clear the authentication state
- Removed unused testing tooling (e.g., `@visibleForTesting`) from the codebase

Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
This commit is contained in:
2024-09-20 15:10:00 +02:00
parent 03e3a0bcbd
commit 05624263fb
7 changed files with 117 additions and 63 deletions
@@ -51,6 +51,27 @@ abstract class ArcaneAuthInterface {
required String password,
});
/// Logs the user in using an optional, generic `T` type of input.
/// This login method is a generic method that can be used to login with any
/// type of input. It is useful for login methods that do not require an email
/// and password. Any type of input can be passed in, and it will be handled
/// by the implementation of the method wihin the specific authentication
/// service.
///
/// Example:
/// ```dart
/// await authInterface.login<Map<String, String>>(
/// input: {
/// "username": "hello@world.com",
/// "password": "password",
/// },
/// );
/// ```
Future<Result<void, String>> login<T>({
T? input,
Future<void> Function()? onLoggedIn,
});
/// Re-sends a verification code to the user's email address.
///
/// This method is typically used when the user hasn't received or has lost their initial