Spaces:
Sleeping
Sleeping
Download src/modules/auth/auth.module.ts from anhkhoiphan/092_UI_core: direct link, hf CLI and curl.
- Browser
- Download file 977 Bytes
-
https://huggingface.co/spaces/anhkhoiphan/092_UI_core/resolve/main/src/modules/auth/auth.module.ts
- Command line
-
hf download hf://spaces/anhkhoiphan/092_UI_core/src/modules/auth/auth.module.ts
-
curl -L -o auth.module.ts https://huggingface.co/spaces/anhkhoiphan/092_UI_core/resolve/main/src/modules/auth/auth.module.ts
977 Bytes
| import { Module } from '@nestjs/common'; | |
| import { JwtModule } from '@nestjs/jwt'; | |
| import { ConfigModule, ConfigService } from '@nestjs/config'; | |
| import { PassportModule } from '@nestjs/passport'; | |
| import { AuthService } from './auth.service'; | |
| import { AuthController } from './auth.controller'; | |
| import { JwtStrategy } from './strategies/jwt.strategy'; | |
| ({ | |
| imports: [ | |
| PassportModule.register({ defaultStrategy: 'jwt' }), | |
| JwtModule.registerAsync({ | |
| imports: [ConfigModule], | |
| inject: [ConfigService], | |
| useFactory: (configService: ConfigService) => ({ | |
| secret: configService.get<string>('jwt.secret'), | |
| signOptions: { | |
| expiresIn: configService.get<string>( | |
| 'jwt.accessExpiration', | |
| '15m', | |
| ) as `${number}${'s' | 'm' | 'h' | 'd'}`, | |
| }, | |
| }), | |
| }), | |
| ], | |
| controllers: [AuthController], | |
| providers: [AuthService, JwtStrategy], | |
| exports: [AuthService], | |
| }) | |
| export class AuthModule {} | |