refactor(frontend): adapt to RESTful API routes
This commit is contained in:
@@ -17,7 +17,7 @@ class AuthBloc extends Bloc<AuthEvent, AuthState> {
|
||||
final refreshToken = await _repository.getRefreshToken();
|
||||
if (refreshToken != null) {
|
||||
try {
|
||||
final response = await _repository.refresh(refreshToken);
|
||||
final response = await _repository.refreshSession(refreshToken);
|
||||
emit(
|
||||
AuthAuthenticated(
|
||||
user: AuthUser(id: response.user.id, email: response.user.email),
|
||||
@@ -25,7 +25,7 @@ class AuthBloc extends Bloc<AuthEvent, AuthState> {
|
||||
);
|
||||
return;
|
||||
} catch (_) {
|
||||
await _repository.logout();
|
||||
await _repository.deleteSession();
|
||||
}
|
||||
}
|
||||
emit(AuthUnauthenticated());
|
||||
@@ -39,7 +39,7 @@ class AuthBloc extends Bloc<AuthEvent, AuthState> {
|
||||
AuthLoggedOut event,
|
||||
Emitter<AuthState> emit,
|
||||
) async {
|
||||
await _repository.logout();
|
||||
await _repository.deleteSession();
|
||||
emit(AuthUnauthenticated());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user