Spaces:
Runtime error
Runtime error
Download backend/src/modules/auth/auth.module.ts from Denisijcu/medicodeapp: direct link, hf CLI and curl.
- Browser
- Download file 1.04 kB
-
https://huggingface.co/spaces/Denisijcu/medicodeapp/resolve/main/backend/src/modules/auth/auth.module.ts
- Command line
-
hf download hf://spaces/Denisijcu/medicodeapp/backend/src/modules/auth/auth.module.ts
-
curl -L -o auth.module.ts https://huggingface.co/spaces/Denisijcu/medicodeapp/resolve/main/backend/src/modules/auth/auth.module.ts
1.04 kB
| import { Module } from '@nestjs/common'; | |
| import { JwtModule } from '@nestjs/jwt'; | |
| import { PassportModule } from '@nestjs/passport'; | |
| import { MongooseModule } from '@nestjs/mongoose'; | |
| import { ConfigService } from '@nestjs/config'; | |
| import { AuthController } from './auth.controller'; | |
| import { AuthService } from './auth.service'; | |
| import { JwtStrategy } from './strategies/jwt.strategy'; | |
| import { User, UserSchema } from './schemas/user.schema'; | |
| ({ | |
| imports: [ | |
| MongooseModule.forFeature([{ name: User.name, schema: UserSchema }]), | |
| PassportModule.register({ defaultStrategy: 'jwt' }), | |
| JwtModule.registerAsync({ | |
| inject: [ConfigService], | |
| useFactory: (config: ConfigService) => ({ | |
| secret: config.get<string>('JWT_SECRET', 'medicode-secret-key'), | |
| signOptions: { expiresIn: config.get<string>('JWT_EXPIRES', '7d') }, | |
| }), | |
| }), | |
| ], | |
| controllers: [AuthController], | |
| providers: [AuthService, JwtStrategy], | |
| exports: [JwtStrategy, PassportModule, AuthService], | |
| }) | |
| export class AuthModule {} | |