fix: auth

This commit is contained in:
BLoC
2025-02-17 12:41:43 +03:00
parent 66e2578619
commit fea83bb7bd
4 changed files with 8 additions and 5 deletions

View File

@@ -17,11 +17,12 @@ class AuthCubit extends Cubit<AuthState> {
getTokenByCredentials(String email, String password) async {
emit(AuthState.loading());
try {
final String token = (await authRepository.getTokenByCredentials(
final token = (await authRepository.getTokenByCredentials(
email,
password,
))
.token;
print(token);
emit(
AuthState.loaded(
token: token,
@@ -31,6 +32,7 @@ class AuthCubit extends Cubit<AuthState> {
await sl<ProfileAvatarCubit>().getMyProfile();
AppRouter.navigatorKey.currentContext?.go('/my-profile-screen');
} catch (e) {
print(e);
emit(AuthState.error(errorMessage: '$e'));
}
}