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