diff --git a/client_app/lib/router.dart b/client_app/lib/router.dart index a016996..8282319 100644 --- a/client_app/lib/router.dart +++ b/client_app/lib/router.dart @@ -38,8 +38,11 @@ GoRouter buildRouter(Ref ref) { final isAuthRoute = state.matchedLocation.startsWith('/auth') || state.matchedLocation == '/welcome'; - // Show splash while loading - if (authState is AsyncLoading) return isSplash ? null : '/splash'; + // Show splash only during initial load — don't redirect away from auth routes + if (authState is AsyncLoading) { + if (isSplash || isAuthRoute) return null; + return '/splash'; + } final data = authState.valueOrNull; if (data == null) { diff --git a/mitra_app/lib/router.dart b/mitra_app/lib/router.dart index a48fb4b..b1157bd 100644 --- a/mitra_app/lib/router.dart +++ b/mitra_app/lib/router.dart @@ -33,8 +33,11 @@ GoRouter buildRouter(Ref ref) { final isAuthRoute = state.matchedLocation.startsWith('/login') || state.matchedLocation.startsWith('/otp'); - // Show splash while loading - if (authState is AsyncLoading) return isSplash ? null : '/splash'; + // Show splash only during initial load — don't redirect away from auth routes + if (authState is AsyncLoading) { + if (isSplash || isAuthRoute) return null; + return '/splash'; + } final data = authState.valueOrNull; if (data == null) {