package dev.ulfrx.recipe.ui.screens.auth

import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import dev.ulfrx.recipe.auth.AuthBrowser
import dev.ulfrx.recipe.auth.AuthSession
import kotlinx.coroutines.launch

/**
 * Trivial in Phase 2 — exists so Phase 3's `HouseholdGate` follows the same VM pattern.
 * Logout is silent (CONTEXT D-19): no confirmation modal; tap immediately initiates
 * RP-initiated end-session via [AuthSession.logout]. The screen supplies the
 * Lokksmith-backed [AuthBrowser].
 */
class PostLoginViewModel(
    private val authSession: AuthSession,
) : ViewModel() {
    fun onSignOutClick(browser: AuthBrowser) {
        viewModelScope.launch {
            authSession.logout(browser)
        }
    }
}
