feat(02-06): wire auth session into koin

- provide authModule singletons for store, OIDC, MeClient, AuthSession, and HttpClient
- include authModule from appModule bootstrap
This commit is contained in:
2026-04-28 16:55:36 +02:00
parent 0a24be9a95
commit 938f324bb8
2 changed files with 21 additions and 1 deletions

View File

@@ -0,0 +1,19 @@
package dev.ulfrx.recipe.auth
import io.ktor.client.HttpClient
import org.koin.dsl.module
val authModule =
module {
single<SecureAuthStateStore> { SecureAuthStateStore() }
single<OidcClient> { OidcClient() }
single<MeClient> { MeClient() }
single<AuthSession> {
AuthSession(
oidcClient = get<OidcClient>(),
store = get<SecureAuthStateStore>(),
meClient = get<MeClient>(),
)
}
single<HttpClient> { AuthHttpClient.create(get()) }
}

View File

@@ -1,9 +1,10 @@
package dev.ulfrx.recipe.di package dev.ulfrx.recipe.di
import dev.ulfrx.recipe.auth.authModule
import org.koin.dsl.module import org.koin.dsl.module
// Phase 2 adds authModule; Phase 4 adds syncModule; Phase 5 adds catalogModule; etc. // Phase 2 adds authModule; Phase 4 adds syncModule; Phase 5 adds catalogModule; etc.
val appModule = val appModule =
module { module {
// intentionally empty in Phase 1 includes(authModule)
} }