UNPKG

graphdb-workbench

Version:
38 lines (37 loc) 1.59 kB
import { AuthStrategyType } from '../../../models/security/authentication'; import { BaseGdbLoginStrategy } from './base-gdb-login-strategy'; import { AuthenticatedUser } from '../../../models/security'; export declare class GdbTokenAuthStrategy extends BaseGdbLoginStrategy { private readonly securityContextService; type: AuthStrategyType; /** * Initializes the authentication strategy. If the current route is 'login', resolves immediately. * Otherwise, attempts to load the authenticated user and update the security context. * Logs an error if the user cannot be loaded. * @returns Promise resolving to true if user is logged in * */ initialize(): Promise<boolean>; /** * Fetches the currently authenticated user using the security service. * * @returns A promise that resolves to the authenticated user. */ fetchAuthenticatedUser(): Promise<AuthenticatedUser>; /** * Logs out the current user by clearing the authentication token. * @returns {Promise<void>} A promise that resolves when logout is complete. */ logout(): Promise<void>; /** * Checks if the user is authenticated. * Returns true if security is disabled or if an authentication token is present. * @returns {boolean} True if authenticated, false otherwise. */ isAuthenticated(): boolean; /** * Indicates that this strategy is not for external users. * @returns false, as this strategy is not for external authentication. */ isExternal(): boolean; private isCurrentRouteLogin; }