Add error handling to login method

Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
This commit is contained in:
2024-09-17 13:01:36 +02:00
parent 32c36413d6
commit 4e22c08ed9
@@ -186,11 +186,13 @@ class ArcaneAuthenticationService extends ArcaneService {
password: password,
);
if (result.isSuccess) {
setAuthenticated();
if (onLoggedIn != null) await onLoggedIn();
if (result.isFailure) {
throw Exception(result.error);
}
setAuthenticated();
if (onLoggedIn != null) await onLoggedIn();
return result;
}