mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-28 13:40:57 +00:00
25 lines
739 B
TypeScript
25 lines
739 B
TypeScript
import { Module } from '@nestjs/common';
|
|
import { JwtModule } from '@nestjs/jwt';
|
|
import { PassportModule } from '@nestjs/passport';
|
|
import { ConfigService } from '@nestjs/config';
|
|
import { AuthController } from './auth.controller';
|
|
import { AuthService } from './auth.service';
|
|
import { JwtStrategy } from '../../common/jwt.strategy';
|
|
|
|
@Module({
|
|
imports: [
|
|
PassportModule,
|
|
JwtModule.registerAsync({
|
|
inject: [ConfigService],
|
|
useFactory: (c: ConfigService) => ({
|
|
secret: c.get('JWT_SECRET'),
|
|
signOptions: { expiresIn: c.get('JWT_EXPIRES_IN', '7d') },
|
|
}),
|
|
}),
|
|
],
|
|
controllers: [AuthController],
|
|
providers: [AuthService, JwtStrategy],
|
|
exports: [JwtModule],
|
|
})
|
|
export class AuthModule {}
|