AuthProvider

interface AuthProvider

Interface for authentication providers.

Implementations handle platform-specific auth flows and secure token storage. Used by backup providers (Google Drive, etc.) for authentication.

Inheritors

Functions

Link copied to clipboard
open suspend fun ensureSignedIn()

Ensure user is signed in, triggering sign-in flow if needed.

Link copied to clipboard
abstract suspend fun getAccessToken(): String?

Get an access token for API calls.

Link copied to clipboard
abstract fun getSignedInEmail(): String?

Get the signed-in user's email, or null if not signed in.

Link copied to clipboard
abstract fun isSignedIn(): Boolean

Check if user is currently signed in.

Link copied to clipboard
abstract suspend fun refreshAccessToken(): String?

Force-refresh the access token, invalidating any cached token.

Link copied to clipboard
abstract suspend fun signIn(): Result<AuthResult>

Trigger the sign-in flow.