Created
March 4, 2019 15:20
-
-
Save saurabhpati/143f5677ef07fad89696bd5cea7df973 to your computer and use it in GitHub Desktop.
Auth module
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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