package dev.inmo.postssystem.client.settings.auth

import dev.inmo.postssystem.features.auth.client.ui.AuthUIError
import dev.inmo.postssystem.features.auth.common.AuthCreds
import dev.inmo.postssystem.features.roles.common.Role
import dev.inmo.postssystem.features.users.common.User
import kotlinx.coroutines.Job
import kotlinx.coroutines.flow.StateFlow
import org.koin.core.module.Module

interface AuthSettings {
    val authorizedDIModule: StateFlow<Module?>
    val user: StateFlow<User?>
    val userRoles: StateFlow<List<Role>>
    val loadingJob: Job

    suspend fun auth(serverUrl: String, creds: AuthCreds): AuthUIError?
}
