@nestjs/passport

  • Version 11.0.5
  • Published
  • 22.8 kB
  • No dependencies
  • MIT license

Install

npm i @nestjs/passport
yarn add @nestjs/passport
pnpm add @nestjs/passport

Overview

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

Index

Functions

function AuthGuard

AuthGuard: (type?: string | string[]) => Type<IAuthGuard>;

    function PassportStrategy

    PassportStrategy: <
    T extends Type<any> = any,
    TUser = unknown,
    TValidationResult = false | TUser
    >(
    Strategy: T,
    name?: string,
    callbackArity?: true | number
    ) => new (...args: WithoutCallback<AllConstructorParameters<T>>) => InstanceType<T> &
    PassportStrategyMixin<TValidationResult>;

      Classes

      class AbstractStrategy

      abstract class AbstractStrategy {}

        method validate

        abstract validate: (...args: any[]) => any;

          class AuthModuleOptions

          class AuthModuleOptions implements IAuthModuleOptions {}

            property defaultStrategy

            defaultStrategy?: string | string[];

              property property

              property?: string;

                property session

                session?: boolean;

                  class PassportModule

                  class PassportModule {}

                    method register

                    static register: (options: IAuthModuleOptions) => DynamicModule;

                      method registerAsync

                      static registerAsync: (options: AuthModuleAsyncOptions) => DynamicModule;

                        class PassportSerializer

                        abstract class PassportSerializer {}

                          constructor

                          constructor();

                            method deserializeUser

                            abstract deserializeUser: (payload: any, done: Function) => any;

                              method getPassportInstance

                              getPassportInstance: () => passport.PassportStatic;

                                method serializeUser

                                abstract serializeUser: (user: any, done: Function) => any;

                                  Interfaces

                                  interface AuthModuleAsyncOptions

                                  interface AuthModuleAsyncOptions extends Pick<ModuleMetadata, 'imports'> {}

                                    property inject

                                    inject?: any[];

                                      property useClass

                                      useClass?: Type<AuthOptionsFactory>;

                                        property useExisting

                                        useExisting?: Type<AuthOptionsFactory>;

                                          property useFactory

                                          useFactory?: (
                                          ...args: any[]
                                          ) => Promise<IAuthModuleOptions> | IAuthModuleOptions;

                                            interface AuthOptionsFactory

                                            interface AuthOptionsFactory {}

                                              method createAuthOptions

                                              createAuthOptions: () => Promise<IAuthModuleOptions> | IAuthModuleOptions;

                                                interface IAuthModuleOptions

                                                interface IAuthModuleOptions {}

                                                  property defaultStrategy

                                                  defaultStrategy?: string | string[];

                                                    property property

                                                    property?: string;

                                                      property session

                                                      session?: boolean;

                                                        index signature

                                                        [key: string]: any;

                                                          interface Type

                                                          interface Type<T = any> extends Function {}

                                                            construct signature

                                                            new (...args: any[]): T;

                                                              Type Aliases

                                                              type AllConstructorParameters

                                                              type AllConstructorParameters<T> = T extends {
                                                              new (...o: infer U): void;
                                                              new (...o: infer U2): void;
                                                              new (...o: infer U3): void;
                                                              new (...o: infer U4): void;
                                                              new (...o: infer U5): void;
                                                              new (...o: infer U6): void;
                                                              new (...o: infer U7): void;
                                                              }
                                                              ? U | U2 | U3 | U4 | U5 | U6 | U7
                                                              : T extends {
                                                              new (...o: infer U): void;
                                                              new (...o: infer U2): void;
                                                              new (...o: infer U3): void;
                                                              new (...o: infer U4): void;
                                                              new (...o: infer U5): void;
                                                              new (...o: infer U6): void;
                                                              }
                                                              ? U | U2 | U3 | U4 | U5 | U6
                                                              : T extends {
                                                              new (...o: infer U): void;
                                                              new (...o: infer U2): void;
                                                              new (...o: infer U3): void;
                                                              new (...o: infer U4): void;
                                                              new (...o: infer U5): void;
                                                              }
                                                              ? U | U2 | U3 | U4 | U5
                                                              : T extends {
                                                              new (...o: infer U): void;
                                                              new (...o: infer U2): void;
                                                              new (...o: infer U3): void;
                                                              new (...o: infer U4): void;
                                                              }
                                                              ? U | U2 | U3 | U4
                                                              : T extends {
                                                              new (...o: infer U): void;
                                                              new (...o: infer U2): void;
                                                              new (...o: infer U3): void;
                                                              }
                                                              ? U | U2 | U3
                                                              : T extends {
                                                              new (...o: infer U): void;
                                                              new (...o: infer U2): void;
                                                              }
                                                              ? U | U2
                                                              : T extends {
                                                              new (...o: infer U): void;
                                                              }
                                                              ? U
                                                              : never;

                                                                type IAuthGuard

                                                                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
                                                                ): IAuthModuleOptions | undefined;
                                                                getRequest(context: ExecutionContext): any;
                                                                };

                                                                  type WithoutCallback

                                                                  type WithoutCallback<T extends any[]> = T extends any
                                                                  ? T extends [...infer U, infer C]
                                                                  ? C extends Function
                                                                  ? U
                                                                  : T
                                                                  : T
                                                                  : never;

                                                                    Package Files (8)

                                                                    Dependencies (0)

                                                                    No dependencies.

                                                                    Dev Dependencies (34)

                                                                    Peer Dependencies (2)

                                                                    Badge

                                                                    To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                                                                    You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@nestjs/passport.

                                                                    • Markdown
                                                                      [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@nestjs/passport)
                                                                    • HTML
                                                                      <a href="https://www.jsdocs.io/package/@nestjs/passport"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>