1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| import { Module } from '@nestjs/common'; import { AuthService } from './auth.service'; import { JwtStrategy } from './jwt.strategy'; import { JwtModule} from '@nestjs/jwt'; import { AuthController } from './auth.controller'; import { PassportModule } from '@nestjs/passport'; @Module({ imports: [ PassportModule.register({ defaultStrategy: 'jwt',session:false }), JwtModule.register({ secret: 'jwtConstants.secret', signOptions: { expiresIn: '2h' }, }) ], providers: [AuthService,JwtStrategy], ontrollers:[AuthController], exports: [AuthService], }) export class AuthModule {}
|