-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathindex.ts
More file actions
25 lines (24 loc) · 780 Bytes
/
index.ts
File metadata and controls
25 lines (24 loc) · 780 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import { Module } from '@nestjs/common';
import { JwtModule } from '@nestjs/jwt';
import { PassportModule } from '@nestjs/passport';
import config from 'config';
import { UserModule } from '../User';
import { AuthResolver } from './Auth.resolver';
import { AuthService } from './Auth.service';
import { JWTStrategy } from './strategies/jwt.strategy';
import { LocalStrategy } from './strategies/local.strategy';
@Module({
imports: [
UserModule,
PassportModule.register({
defaultStrategy: 'jwt'
}),
JwtModule.register({
secret: config.get('auth.jwtSecret'),
signOptions: { expiresIn: '1h' }
})
],
providers: [AuthResolver, AuthService, LocalStrategy, JWTStrategy],
exports: [AuthService, PassportModule]
})
export class AuthModule {}