mirror of
https://gitee.com/qqtt-ah/ecom-dmb.git
synced 2026-11-23 23:19:19 +08:00
24 lines
809 B
TypeScript
24 lines
809 B
TypeScript
import { Module } from '@nestjs/common';
|
|
import { JwtModule } from '@nestjs/jwt';
|
|
import { PassportModule } from '@nestjs/passport';
|
|
import { TypeOrmModule } from '@nestjs/typeorm';
|
|
import { LcAdmin } from '../../entities/lc-admin.entity';
|
|
import { AuthController } from './auth.controller';
|
|
import { AuthService } from './auth.service';
|
|
import { JwtStrategy } from './jwt.strategy';
|
|
|
|
@Module({
|
|
imports: [
|
|
TypeOrmModule.forFeature([LcAdmin]),
|
|
PassportModule.register({ defaultStrategy: 'jwt' }),
|
|
JwtModule.register({
|
|
secret: process.env.JWT_SECRET || 'change-me-in-production',
|
|
signOptions: { expiresIn: process.env.JWT_EXPIRES_IN || '8h' },
|
|
}),
|
|
],
|
|
controllers: [AuthController],
|
|
providers: [AuthService, JwtStrategy],
|
|
exports: [JwtModule],
|
|
})
|
|
export class AuthModule {}
|