0.0.7 • Published 1 year ago

nestjs-oauth2 v0.0.7

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Features

Installation

yarn add nestjs-oauth2

Usage

Please refer to the example for more details.

Settings

Import OAuthModule

Import the module at your app module.

import { OAuthModule, spotifyOptions, googleOptions } from "nestjs-oauth2";

@Module({
  imports: [
    ConfigModule.forRoot({ isGlobal: true }),
    OAuthModule.forFeatureAsync({
      useFactory: (config: ConfigService<Environments>) => [
        {
          ...spotifyOptions,
          clientId: config.get("SPOTIFY_CLIENT_ID"),
          clientSecret: config.get("SPOTIFY_CLIENT_SECRET"),
          scope: "user-read-private user-read-email",
          redirectUri: "http://localhost:4200/oauth/spotify/callback",
        },
        {
          ...googleOptions,
          clientId: config.get("GOOGLE_CLIENT_ID"),
          clientSecret: config.get("GOOGLE_CLIENT_SECRET"),
          scope: "https://www.googleapis.com/auth/drive.metadata.readonly",
          redirectUri: "http://localhost:4200/oauth/google/callback",
        },
      ],
      inject: [ConfigService],
    }),
  ],
  controllers: [AppController],
  providers: [],
})
export class AppModule {}
0.0.7

1 year ago

0.0.6

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.31

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago

0.0.0

1 year ago