@mercury-labs/auth
Version:
Mercury framework auth library. It supports local auth, jwt with both bearer token and cookie, basic auth.
14 lines (13 loc) • 517 B
TypeScript
import { CanActivate, ExecutionContext } from '@nestjs/common';
import { IAuthDefinitions } from '../../domain';
export interface IBasicAuthCredentials {
username: string;
password: string;
}
export declare class AuthBasicGuard implements CanActivate {
private _credentials;
constructor(credentials: IAuthDefinitions);
canActivate(context: ExecutionContext): boolean;
protected validateToken(token: string): boolean;
protected validateLogin(username: string, password: string): boolean;
}