UNPKG

@mercury-labs/auth

Version:

Mercury framework auth library. It supports local auth, jwt with both bearer token and cookie, basic auth.

17 lines (16 loc) 837 B
import { Strategy } from 'passport-jwt'; import { IAuthDefinitions } from '../../domain'; import type { IAuthUserEntityForResponse } from '../definitions'; import { IJwtPayload } from '../entities'; import { AuthRepository } from '../repositories'; import { TokenService } from '../services'; export declare const JWT_STRATEGY_NAME: string; declare const JwtStrategy_base: new (...args: any[]) => Strategy; export declare class JwtStrategy extends JwtStrategy_base { protected readonly authDefinitions: IAuthDefinitions; protected readonly authRepository: AuthRepository; protected readonly jwtService: TokenService; constructor(authDefinitions: IAuthDefinitions, authRepository: AuthRepository, jwtService: TokenService); validate(payload: IJwtPayload): Promise<IAuthUserEntityForResponse | undefined>; } export {};