mirror of
https://github.com/SyncrowIOT/web.git
synced 2026-10-26 04:17:56 +00:00
access management design revamp, responsiveness and buttons
This commit is contained in:
@@ -135,6 +135,7 @@ class AuthBloc extends Bloc<AuthEvent, AuthState> {
|
||||
emit(const LoginFailure(error: 'Something went wrong'));
|
||||
return;
|
||||
}
|
||||
|
||||
token = await AuthenticationAPI.loginWithEmail(
|
||||
model: LoginWithEmailModel(
|
||||
email: event.username,
|
||||
@@ -143,10 +144,10 @@ class AuthBloc extends Bloc<AuthEvent, AuthState> {
|
||||
);
|
||||
} catch (failure) {
|
||||
validate = 'Invalid Credentials!';
|
||||
emit(AuthInitialState());
|
||||
// emit(const LoginFailure(error: 'Something went wrong'));
|
||||
emit(const LoginFailure(error: 'Invalid Credentials!'));
|
||||
return;
|
||||
}
|
||||
|
||||
if (token.accessTokenIsNotEmpty) {
|
||||
FlutterSecureStorage storage = const FlutterSecureStorage();
|
||||
await storage.write(
|
||||
@@ -155,7 +156,6 @@ class AuthBloc extends Bloc<AuthEvent, AuthState> {
|
||||
key: UserModel.userUuidKey,
|
||||
value: Token.decodeToken(token.accessToken)['uuid'].toString());
|
||||
user = UserModel.fromToken(token);
|
||||
debugPrint(token.accessToken);
|
||||
loginEmailController.clear();
|
||||
loginPasswordController.clear();
|
||||
emit(LoginSuccess());
|
||||
|
||||
Reference in New Issue
Block a user