Turn off app authentication for easier tests

This commit is contained in:
2026-05-09 10:54:18 +02:00
parent 794e27c554
commit 568e793c44

View File

@@ -51,22 +51,24 @@ internal fun resolveRootRoute(
@Preview
fun App() {
RecipeTheme {
val authSession = koinInject<AuthSession>()
val userRepository = koinInject<UserRepository>()
val authState by authSession.state.collectAsStateWithLifecycle()
val currentUser by userRepository.currentUser.collectAsStateWithLifecycle()
// Kick off the persisted-session restore once. AuthSession.initialize()
// refreshes the stored AuthState (or transitions to Unauthenticated on
// empty store / refresh failure) and the gate below recomposes accordingly.
LaunchedEffect(authSession) {
authSession.initialize()
}
when (resolveRootRoute(authState, hasCurrentUser = currentUser != null)) {
RootRoute.Splash -> SplashScreen()
RootRoute.Login -> LoginScreen(viewModel = koinViewModel<LoginViewModel>())
RootRoute.Shell -> AppShell()
}
// val authSession = koinInject<AuthSession>()
// val userRepository = koinInject<UserRepository>()
// val authState by authSession.state.collectAsStateWithLifecycle()
// val currentUser by userRepository.currentUser.collectAsStateWithLifecycle()
//
// // Kick off the persisted-session restore once. AuthSession.initialize()
// // refreshes the stored AuthState (or transitions to Unauthenticated on
// // empty store / refresh failure) and the gate below recomposes accordingly.
// LaunchedEffect(authSession) {
// authSession.initialize()
// }
//
// when (resolveRootRoute(authState, hasCurrentUser = currentUser != null)) {
// RootRoute.Splash -> SplashScreen()
// RootRoute.Login -> LoginScreen(viewModel = koinViewModel<LoginViewModel>())
// RootRoute.Shell -> AppShell()
// }
//for easier tests authentication is turned off
AppShell()
}
}