Spaces:
Paused
Paused
| import { Module } from '@nestjs/common'; | |
| import { ConfigModule, ConfigService } from '@nestjs/config'; | |
| import { JwtModule } from '@nestjs/jwt'; | |
| import { PassportModule } from '@nestjs/passport'; | |
| import { UsersModule } from '../users/users.module'; | |
| import { AuthController } from './auth.controller'; | |
| import { AuthService } from './auth.service'; | |
| import { JwtStrategy } from './jwt.strategy'; | |
| import { TwitterStrategy } from './twitter.strategy'; | |
| ({ | |
| imports: [ | |
| UsersModule, | |
| PassportModule, | |
| JwtModule.registerAsync({ | |
| imports: [ConfigModule], | |
| useFactory: async (configService: ConfigService) => ({ | |
| secret: configService.get<string>('JWT_SECRET'), | |
| signOptions: { expiresIn: configService.get<string>('JWT_EXPIRATION_TIME') }, | |
| }), | |
| inject: [ConfigService], | |
| }), | |
| ], | |
| controllers: [AuthController], | |
| providers: [AuthService, JwtStrategy, TwitterStrategy], | |
| }) | |
| export class AuthModule {} |