UNPKG

@kernel-js/auth

Version:
33 lines (32 loc) 856 B
import { AxiosInstance } from 'axios'; import AuthenticationInterface from '../interfaces/AuthenticationInterface'; export default class BaseAuthentication implements AuthenticationInterface { protected _storage: any; protected _request: AxiosInstance; /** * @param {object} config */ constructor(config: object); /** * Check if an authenticated user exists. * @returns boolean */ isGuest(): boolean; /** * Opposite method isGuest. * @returns boolean */ isAuthenticated(): boolean; /** * Gets user access tokens. * @param {object} params * @param {string} url * @returns Promise */ login(params?: object, url?: string): Promise<any>; /** * Clears all user data by logging out. * @returns Promise */ logout(): Promise<any>; }