forked from eatvio/eatvio_app
Add SessionLifecycleService to reset user-scoped cubits, analytics, socket id and account-scoped preferences on logout, 401 or account deletion. Run the same refresh after every successful auth path, including registration v1/v2, and ignore 401 responses from stale tokens so an old request cannot terminate the new user's session. Refs: #1113
16 lines
513 B
Dart
16 lines
513 B
Dart
import 'package:eatvio_app/core/error_reporting/error_reporter.dart';
|
|
import 'package:eatvio_app/core/locator_service.dart';
|
|
import 'package:eatvio_app/core/session/session_lifecycle_service.dart';
|
|
import 'package:eatvio_app/core/websockets/ws_manager.dart';
|
|
|
|
class SessionRegistrations {
|
|
static void registerAll() {
|
|
sl.registerLazySingleton<SessionLifecycleService>(
|
|
() => SessionLifecycleService(
|
|
wsManager: sl<WsManager>(),
|
|
errorReporter: sl<ErrorReporter>(),
|
|
),
|
|
);
|
|
}
|
|
}
|