FakeAuthRepository

class FakeAuthRepository(initialUser: AuthUser? = null) : AuthRepository

In-memory AuthRepository fake. Every sign-in succeeds with a deterministic user unless nextFailure is set, in which case the next call fails with it (once). Sign-in state is observable through authStateFlow, so it drives an AuthSessionInitializer end to end.

Constructors

Link copied to clipboard
constructor(initialUser: AuthUser? = null)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
open override val currentUser: AuthUser?
Link copied to clipboard
open override val isAnonymous: Boolean
Link copied to clipboard
open override val isAuthenticated: Boolean
Link copied to clipboard

When non-null, the next suspending call returns Result.failure(nextFailure) and clears it.

Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
open override fun authStateFlow(): StateFlow<AuthUser?>
Link copied to clipboard
open suspend override fun createAccountWithEmailAndPassword(email: String, password: String): Result<AuthUser>
Link copied to clipboard
open suspend override fun deleteAccount(): Result<Unit>
Link copied to clipboard
fun emit(authUser: AuthUser?)

Sets the signed-in user directly (e.g. to simulate a provider-side session change).

Link copied to clipboard
open suspend override fun sendPasswordResetEmail(email: String): Result<Unit>
Link copied to clipboard
open suspend override fun sendSignInLinkToEmail(email: String, continueUrl: String): Result<Unit>
Link copied to clipboard
open suspend override fun signInAnonymously(): Result<AuthUser>
Link copied to clipboard
open suspend override fun signInWithApple(activity: Activity): Result<AuthUser>
Link copied to clipboard
open suspend override fun signInWithEmailAndPassword(email: String, password: String): Result<AuthUser>
Link copied to clipboard
open suspend override fun signInWithGoogle(idToken: String): Result<AuthUser>
Link copied to clipboard
open override fun signOut()