From 32c36413d66891d9ac969ca1f2e066dbeae5ff49 Mon Sep 17 00:00:00 2001 From: Hans Kokx Date: Tue, 17 Sep 2024 13:00:24 +0200 Subject: [PATCH] Make onLoggedOut method a future Signed-off-by: Hans Kokx --- lib/src/services/authentication/authentication_service.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/src/services/authentication/authentication_service.dart b/lib/src/services/authentication/authentication_service.dart index 55f769b..703fdd7 100644 --- a/lib/src/services/authentication/authentication_service.dart +++ b/lib/src/services/authentication/authentication_service.dart @@ -146,7 +146,7 @@ class ArcaneAuthenticationService extends ArcaneService { /// Logs the current user out. Upon successful logout, `status` will be set to /// `AuthenticationStatus.unauthenticated`. - Future logOut({VoidCallback? onLoggedOut}) async { + Future logOut({Future Function()? onLoggedOut}) async { if (_mocked) return; if (!isAuthenticated) return; @@ -155,7 +155,7 @@ class ArcaneAuthenticationService extends ArcaneService { await loggedOut.fold( onSuccess: (_) async { setUnauthenticated(); - if (onLoggedOut != null) onLoggedOut(); + if (onLoggedOut != null) await onLoggedOut(); }, onError: (e) { throw Exception(e);