Spaces:
Sleeping
Sleeping
| import { Module } from '@nestjs/common'; | |
| import { JwtModule } from '@nestjs/jwt'; | |
| import { PassportModule } from '@nestjs/passport'; | |
| import { ConfigModule, ConfigService } from '@nestjs/config'; | |
| import { AuthService } from './auth.service'; | |
| import { AuthController } from './auth.controller'; | |
| import { JwtStrategy } from './jwt.strategy'; | |
| ({ | |
| imports: [ | |
| PassportModule.register({ defaultStrategy: 'jwt' }), | |
| JwtModule.registerAsync({ | |
| imports: [ConfigModule], | |
| inject: [ConfigService], | |
| useFactory: (config: ConfigService) => ({ | |
| secret: config.get<string>('JWT_SECRET', 'wagerkit-jwt-secret-key-2024'), | |
| signOptions: { expiresIn: '24h' }, | |
| }), | |
| }), | |
| ], | |
| controllers: [AuthController], | |
| providers: [AuthService, JwtStrategy], | |
| exports: [AuthService, JwtModule], | |
| }) | |
| export class AuthModule {} | |