Skip to content

Instantly share code, notes, and snippets.

@saurabhpati
Created March 4, 2019 15:20
Show Gist options
  • Save saurabhpati/143f5677ef07fad89696bd5cea7df973 to your computer and use it in GitHub Desktop.
Save saurabhpati/143f5677ef07fad89696bd5cea7df973 to your computer and use it in GitHub Desktop.
Auth module
import { Module } from '@nestjs/common';
import { PassportModule } from '@nestjs/passport';
import { JwtModule } from '@nestjs/jwt';
import { AuthController } from './auth.controller';
import { AuthService } from './auth.service';
import { JwtStrategy } from './jwt.strategy';
import { UserService } from '../user/user.service';
import { UserModule } from '../user/user.module';
@Module({
imports: [
PassportModule.register({ defaultStrategy: 'jwt' }),
JwtModule.register({
secretOrPrivateKey: 'secretKey',
signOptions: {
expiresIn: 3600,
},
}),
UserModule
],
providers: [AuthService, JwtStrategy, UserService],
controllers: [AuthController],
})
export class AuthModule { }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment