From 568e793c44ad4d8d6b6e3afe65c5213d4c7591b7 Mon Sep 17 00:00:00 2001 From: ulfrxdev Date: Sat, 9 May 2026 10:54:18 +0200 Subject: [PATCH] Turn off app authentication for easier tests --- .../commonMain/kotlin/dev/ulfrx/recipe/App.kt | 36 ++++++++++--------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/composeApp/src/commonMain/kotlin/dev/ulfrx/recipe/App.kt b/composeApp/src/commonMain/kotlin/dev/ulfrx/recipe/App.kt index fd32c20..61e4d13 100644 --- a/composeApp/src/commonMain/kotlin/dev/ulfrx/recipe/App.kt +++ b/composeApp/src/commonMain/kotlin/dev/ulfrx/recipe/App.kt @@ -51,22 +51,24 @@ internal fun resolveRootRoute( @Preview fun App() { RecipeTheme { - val authSession = koinInject() - val userRepository = koinInject() - 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()) - RootRoute.Shell -> AppShell() - } +// val authSession = koinInject() +// val userRepository = koinInject() +// 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()) +// RootRoute.Shell -> AppShell() +// } + //for easier tests authentication is turned off + AppShell() } }