package cy.hexor.furumi.domain.repository

import cy.hexor.furumi.domain.model.AuthSession
import cy.hexor.furumi.domain.model.ServerConfig
import cy.hexor.furumi.domain.model.User

interface AuthRepository {
    suspend fun login(config: ServerConfig, password: String): Result<AuthSession>
    suspend fun createSsoAuthorizationUrl(serverUrl: String): Result<String>
    suspend fun completeSsoLogin(callbackUrl: String): Result<AuthSession>
    suspend fun logout(): Result<Unit>
    fun getCurrentSession(): AuthSession?
    fun getSavedServerUrl(): String?

    fun getCurrentUser(): User? {
        return getCurrentSession()?.user
    }
}
