Skip to content

Commit

Permalink
fix: request auth check on app start
Browse files Browse the repository at this point in the history
  • Loading branch information
Xazin committed Apr 18, 2023
1 parent b40af8d commit 3eca475
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/presentation/core/app_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class AppWidget extends StatelessWidget {
return MultiBlocProvider(
providers: [
BlocProvider<AuthBloc>(
create: (_) => getIt<AuthBloc>()..add(AuthEvent.initial()),
create: (_) => getIt<AuthBloc>()..add(AuthEvent.authCheckRequested()),
),
BlocProvider<ProfileBloc>(create: (_) => getIt<ProfileBloc>()),
BlocProvider<ProfileTabBloc>(create: (_) => getIt<ProfileTabBloc>())
Expand All @@ -34,8 +34,9 @@ class AppWidget extends StatelessWidget {
BlocProvider.of<ProfileTabBloc>(context)
.add(FetchProfileTabInfo());
},
unauthenticated: () =>
_appRouter.replaceAll([const UnauthenticatedRoute()]),
unauthenticated: () {
_appRouter.replaceAll([const UnauthenticatedRoute()]);
},
orElse: () {},
);
},
Expand Down

0 comments on commit 3eca475

Please sign in to comment.