Package-level declarations
Types
Link copied to clipboard
interface AuthRepository
Provider-agnostic authentication repository. Bridge this to Firebase Auth, Supabase Auth, or any other auth backend.
Link copied to clipboard
A small persisted hint about the last known session, so a cold-start UI can render optimistically.
Link copied to clipboard
class AuthSessionInitializer(authRepository: AuthRepository, authTokenProvider: AuthTokenProvider, sessionStore: AuthSessionStore, logger: KommonLogger = NoOpLogger, scope: CoroutineScope = CoroutineScope(SupervisorJob() + Dispatchers.Default))
Warms the auth session at cold start: mints/refreshes a token before the first API request can race an unauthenticated call, then keeps sessionStore updated as AuthRepository.authStateFlow changes. Call start early in app startup and stop when its owning app scope is torn down.
Link copied to clipboard
interface AuthSessionStore
Persists AuthSessionHint across app launches (typically backed by encrypted SharedPreferences).
Link copied to clipboard
interface AuthTokenProvider
Supplies the bearer token attached to every outgoing API request.
Functions
Link copied to clipboard
fun Throwable.authSignInErrorMessage(providerName: String, genericFailureMessage: String = "Sign in failed. Please try again."): String
Maps a sign-in failure to a short, user-facing message.