27 lines
820 B
TypeScript
27 lines
820 B
TypeScript
import { Z as ZitadelAuthConfig, a as ZitadelUser, A as AuthState } from './types-C5b7Bv-t.cjs';
|
|
|
|
declare class ZitadelAuth {
|
|
private manager;
|
|
private currentUser;
|
|
private _isLoading;
|
|
private _error;
|
|
private listeners;
|
|
private redirectGuard;
|
|
private prefix;
|
|
constructor(config: ZitadelAuthConfig);
|
|
get isAuthenticated(): boolean;
|
|
get isLoading(): boolean;
|
|
get user(): ZitadelUser | null;
|
|
get accessToken(): string | null;
|
|
get error(): string | null;
|
|
init(): Promise<void>;
|
|
login(): void;
|
|
logout(): Promise<void>;
|
|
requireAuth(): boolean;
|
|
fetch(url: string, init?: RequestInit): Promise<Response>;
|
|
onAuthChange(cb: (state: AuthState) => void): () => void;
|
|
private notify;
|
|
}
|
|
|
|
export { AuthState, ZitadelAuth, ZitadelAuthConfig, ZitadelUser };
|