mirror of
https://github.com/SyncrowIOT/backend.git
synced 2026-10-25 14:47:55 +00:00
authentication module done
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
import { PassportModule } from '@nestjs/passport';
|
||||
import { JwtModule } from '@nestjs/jwt';
|
||||
import { ConfigModule, ConfigService } from '@nestjs/config';
|
||||
import { Module } from '@nestjs/common';
|
||||
import { HelperModule } from '../helper/helper.module';
|
||||
import { JwtStrategy } from './strategies/jwt.strategy';
|
||||
import { UserSessionRepository } from '../modules/session/repositories/session.repository';
|
||||
import { AuthService } from './services/auth.service';
|
||||
import { UserRepository } from '../modules/user/repositories';
|
||||
|
||||
@Module({
|
||||
imports: [
|
||||
ConfigModule.forRoot(),
|
||||
PassportModule,
|
||||
JwtModule.registerAsync({
|
||||
imports: [ConfigModule],
|
||||
inject: [ConfigService],
|
||||
useFactory: async (configService: ConfigService) => ({
|
||||
secret: configService.get('JWT_SECRET'),
|
||||
signOptions: { expiresIn: configService.get('JWT_EXPIRE_TIME') },
|
||||
}),
|
||||
}),
|
||||
HelperModule,
|
||||
],
|
||||
providers: [JwtStrategy, UserSessionRepository,AuthService,UserRepository],
|
||||
exports: [AuthService],
|
||||
})
|
||||
export class AuthModule {}
|
||||
Reference in New Issue
Block a user