mirror of
https://github.com/hanskokx/arcane_framework.git
synced 2026-05-14 10:29:06 +02:00
Make onLoggedOut method a future
Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
This commit is contained in:
@@ -146,7 +146,7 @@ class ArcaneAuthenticationService extends ArcaneService {
|
|||||||
|
|
||||||
/// Logs the current user out. Upon successful logout, `status` will be set to
|
/// Logs the current user out. Upon successful logout, `status` will be set to
|
||||||
/// `AuthenticationStatus.unauthenticated`.
|
/// `AuthenticationStatus.unauthenticated`.
|
||||||
Future<void> logOut({VoidCallback? onLoggedOut}) async {
|
Future<void> logOut({Future<void> Function()? onLoggedOut}) async {
|
||||||
if (_mocked) return;
|
if (_mocked) return;
|
||||||
if (!isAuthenticated) return;
|
if (!isAuthenticated) return;
|
||||||
|
|
||||||
@@ -155,7 +155,7 @@ class ArcaneAuthenticationService extends ArcaneService {
|
|||||||
await loggedOut.fold(
|
await loggedOut.fold(
|
||||||
onSuccess: (_) async {
|
onSuccess: (_) async {
|
||||||
setUnauthenticated();
|
setUnauthenticated();
|
||||||
if (onLoggedOut != null) onLoggedOut();
|
if (onLoggedOut != null) await onLoggedOut();
|
||||||
},
|
},
|
||||||
onError: (e) {
|
onError: (e) {
|
||||||
throw Exception(e);
|
throw Exception(e);
|
||||||
|
|||||||
Reference in New Issue
Block a user