UNPKG

@rxap/authentication

Version:

Provides authentication services, guards, and interceptors for Angular applications. It supports token-based authentication and provides features such as sign-out functionality and routing based on authentication status. This package also includes utiliti

27 lines (26 loc) 1.04 kB
import { BehaviorSubject, Observable, ReplaySubject } from 'rxjs'; import * as i0 from "@angular/core"; export interface IAuthenticationService { isAuthenticated$: Observable<boolean | null>; events$: Observable<AuthenticationEvent>; signOut(): Promise<void>; isAuthenticated(): Promise<boolean>; } export declare enum AuthenticationEventType { OnAuthSuccess = "on-auth-success", OnAuthError = "on-auth-error", OnLogout = "on-logout" } export interface AuthenticationEvent extends Record<string, any> { type: AuthenticationEventType; } export declare class RxapAuthenticationService implements IAuthenticationService { isAuthenticated$: BehaviorSubject<boolean | null>; readonly events$: ReplaySubject<AuthenticationEvent>; private _authenticated; constructor(); signOut(): Promise<void>; isAuthenticated(): Promise<boolean>; static ɵfac: i0.ɵɵFactoryDeclaration<RxapAuthenticationService, never>; static ɵprov: i0.ɵɵInjectableDeclaration<RxapAuthenticationService>; }