Skip to content

Search is only available in production builds. Try building and previewing the site to test it out locally.

@reactor/auth — authstatemanager

@reactor/auth


@reactor/auth / AuthStateManager

Defined in: state.ts:18

Manages auth state including session storage, token refresh, and multi-tab sync.

new AuthStateManager(storage, storageKey?, autoRefresh?, persistSession?, onRefresh?): AuthStateManager

Defined in: state.ts:25

any

string = STORAGE_KEY_DEFAULT

boolean = true

boolean = true

() => Promise<any>

AuthStateManager

clearSession(): Promise<void>

Defined in: state.ts:120

Clear the current session.

Promise<void>


destroy(): void

Defined in: state.ts:270

Cleanup resources.

void


getSession(): any

Defined in: state.ts:74

Get current session.

any


getUser(): any

Defined in: state.ts:81

Get current user.

any


initialize(): Promise<any>

Defined in: state.ts:36

Initialize state from storage.

Promise<any>


onAuthStateChange(callback): object

Defined in: state.ts:127

Subscribe to auth state changes.

AuthStateChangeCallback

object

unsubscribe: () => void

void


refresh(): Promise<any>

Defined in: state.ts:157

Manually trigger a refresh.

Promise<any>


setRefreshCallback(onRefresh): void

Defined in: state.ts:145

Set the refresh callback.

() => Promise<any>

void


setSession(session, event): Promise<void>

Defined in: state.ts:88

Set the current session.

any

AuthStateEvent

Promise<void>