|
@@ -1,9 +1,22 @@
|
|
|
import { HttpModule } from '@nestjs/axios';
|
|
|
import { Module } from '@nestjs/common';
|
|
|
+import { ConfigService } from '@nestjs/config';
|
|
|
+import { JwtModule } from '@nestjs/jwt';
|
|
|
import { AuthController } from './auth.controller';
|
|
|
+import { JwtStrategy } from './strategies/jwt.strategy';
|
|
|
|
|
|
@Module({
|
|
|
- imports: [HttpModule],
|
|
|
+ imports: [
|
|
|
+ HttpModule,
|
|
|
+ JwtModule.registerAsync({
|
|
|
+ inject: [ConfigService],
|
|
|
+ useFactory: async (config: ConfigService) => ({
|
|
|
+ secret: config.get<string>('server.jwt-secret'),
|
|
|
+ signOptions: { expiresIn: '1h' },
|
|
|
+ }),
|
|
|
+ }),
|
|
|
+ ],
|
|
|
+ providers: [JwtStrategy],
|
|
|
controllers: [AuthController],
|
|
|
})
|
|
|
export class AuthModule {}
|