- 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
@@ -45,6 +45,22 @@ class DebugAuthInterface implements ArcaneAuthInterface {
return Result.ok(null);
}
@override
Future<Result<void, String>> login<T>({
T? input,
Future<void> Function()? onLoggedIn,
}) async {
final bool alreadyLoggedIn = await isSignedIn;
if (alreadyLoggedIn) return Result.ok(null);
Arcane.log("Logging: $input");
_isSignedIn = true;
return Result.ok(null);
}
@override
Future<Result<String, String>> resendVerificationCode(String email) async {
Arcane.log("Re-sending verification code to $email");