package dev.ulfrx.recipe.auth

/**
 * Result returned by platform OIDC clients.
 *
 * `authStateJson` is an opaque platform-auth marker persisted by [SecureAuthStateStore].
 * Callers must not parse token values out of it directly.
 */
sealed interface OidcResult {
    data class Success(
        val authStateJson: String,
        val accessToken: String,
        val idToken: String?,
        val expiresAtEpochMillis: Long,
    ) : OidcResult

    data object Cancelled : OidcResult

    data object NetworkError : OidcResult

    data class AuthError(
        val message: String,
        val cause: Throwable? = null,
    ) : OidcResult
}
