/
guselnikov
/
inst
Обзор
Документация
Войти
/
guselnikov
/
inst
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
back/src/modules/auth/auth.module.ts
30 строк
1 KB
Viktor Guselnikov
first_commit
07 июл 2026, 11:54
07 июл 2026, 11:54
098126a
Код
Авторство
О чём код?
import { Module } from '@nestjs/common'; import { JwtModule } from '@nestjs/jwt'; import { PassportModule } from '@nestjs/passport'; import { TypeOrmModule } from '@nestjs/typeorm'; import { ConfigService } from '@nestjs/config'; import { AdminUser } from '../../database/entities/admin-user.entity'; import { Organization } from '../../database/entities/organization.entity'; import { AuthController } from './auth.controller'; import { AuthService } from './auth.service'; import { JwtStrategy } from './jwt.strategy'; @Module({ imports: [ TypeOrmModule.forFeature([AdminUser, Organization]), PassportModule.register({ defaultStrategy: 'jwt' }), JwtModule.registerAsync({ inject: [ConfigService], useFactory: (config: ConfigService) => ({ secret: config.getOrThrow<string>('jwt.secret'), signOptions: { expiresIn: config.get<string>('jwt.expiresIn', '7d') as `${number}d`, }, }), }), ], controllers: [AuthController], providers: [AuthService, JwtStrategy], exports: [AuthService, JwtModule, PassportModule], }) export class AuthModule {}