You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
1.0 KiB
TypeScript
34 lines
1.0 KiB
TypeScript
import { Module } from '@nestjs/common';
|
|
import { JwtModule } from '@nestjs/jwt';
|
|
import { PassportModule } from '@nestjs/passport';
|
|
import { AuthController } from './auth.controller';
|
|
import { AuthService, expires_in } from './auth.service';
|
|
import { JwtStrategy } from './jwt.strategy';
|
|
import { TypeOrmModule } from '@nestjs/typeorm';
|
|
import { UserEntity } from '../user/user.entity';
|
|
// import AuthResolver from './auth.resolver';
|
|
// import { RoleEntity } from '../role/role.entity';
|
|
// import { RoleItemEntity } from '../role-item/role-item.entity';
|
|
|
|
@Module({
|
|
imports: [
|
|
TypeOrmModule.forFeature([
|
|
UserEntity,
|
|
// RoleEntity,
|
|
// RoleItemEntity,
|
|
]),
|
|
PassportModule.register({ defaultStrategy: 'jwt' }),
|
|
JwtModule.register({
|
|
secret: 'secretKey',
|
|
signOptions: {
|
|
expiresIn: expires_in,
|
|
// expiresIn: 3600,
|
|
},
|
|
}),
|
|
],
|
|
controllers: [AuthController],
|
|
providers: [AuthService, JwtStrategy],//, AuthResolver],
|
|
exports: [AuthService],
|
|
})
|
|
export class AuthModule {}
|