From b18a171ac25a4e9a8075e358d6d2bc7889981d88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leon=20B=C3=B6sche?= Date: Thu, 8 Jan 2026 22:09:45 +0100 Subject: [PATCH] idle --- b0esche_cloud/lib/blocs/auth/auth_bloc.dart | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/b0esche_cloud/lib/blocs/auth/auth_bloc.dart b/b0esche_cloud/lib/blocs/auth/auth_bloc.dart index d059bda..f15e90a 100644 --- a/b0esche_cloud/lib/blocs/auth/auth_bloc.dart +++ b/b0esche_cloud/lib/blocs/auth/auth_bloc.dart @@ -1,6 +1,7 @@ import 'package:bloc/bloc.dart'; import '../session/session_bloc.dart'; import '../session/session_event.dart'; +import '../session/session_state.dart'; import 'auth_event.dart'; import 'auth_state.dart'; import '../../services/api_client.dart'; @@ -252,11 +253,12 @@ class AuthBloc extends Bloc { CheckAuthRequested event, Emitter emit, ) async { - // Try to restore session from persistent storage + // Check if session is active from persistent storage final sessionState = sessionBloc.state; if (sessionState is SessionActive) { - // Session already active + // Session already active - emit authenticated state with minimal info + // The full user info will be fetched when needed emit(AuthAuthenticated( token: sessionState.token, userId: '', @@ -264,8 +266,6 @@ class AuthBloc extends Bloc { email: '', )); } else { - // Try to restore from SharedPreferences - await Future.delayed(const Duration(milliseconds: 100)); // Give time for restoration emit(AuthUnauthenticated()); } }