mirror of
https://github.com/hanskokx/arcane_framework.git
synced 2026-05-14 02:19:08 +02:00
Add error handling to login method
Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user