UNPKG

@nestjs/passport

Version:

Nest - modern, fast, powerful node.js web framework (@passport)

17 lines (16 loc) 798 B
import { CanActivate, ExecutionContext } from '@nestjs/common'; import passport from 'passport'; import { Type } from './interfaces/index.js'; export type IAuthGuard = CanActivate & { logIn<TRequest extends { logIn: Function; } = any>(request: TRequest): Promise<void>; handleRequest<TUser = any>(err: any, user: any, info: any, context: ExecutionContext, status?: any): TUser; getAuthenticateOptions(context: ExecutionContext): Promise<AuthGuardAuthenticateOptions> | AuthGuardAuthenticateOptions | undefined; getRequest(context: ExecutionContext): any; }; export type AuthGuardAuthenticateOptions = passport.AuthenticateOptions & { defaultStrategy?: never; [key: string]: any; }; export declare const AuthGuard: (type?: string | string[]) => Type<IAuthGuard>;