mirror of
https://github.com/docmost/docmost.git
synced 2025-11-10 10:22:05 +10:00
33 lines
1.1 KiB
TypeScript
33 lines
1.1 KiB
TypeScript
import { Module } from '@nestjs/common';
|
|
import { AuthController } from './auth.controller';
|
|
import { AuthService } from './services/auth.service';
|
|
import { JwtModule } from '@nestjs/jwt';
|
|
import { EnvironmentService } from '../../integrations/environment/environment.service';
|
|
import { TokenService } from './services/token.service';
|
|
import { JwtStrategy } from './strategies/jwt.strategy';
|
|
import { WorkspaceModule } from '../workspace/workspace.module';
|
|
import { SignupService } from './services/signup.service';
|
|
import { GroupModule } from '../group/group.module';
|
|
|
|
@Module({
|
|
imports: [
|
|
JwtModule.registerAsync({
|
|
useFactory: async (environmentService: EnvironmentService) => {
|
|
return {
|
|
secret: environmentService.getJwtSecret(),
|
|
signOptions: {
|
|
expiresIn: environmentService.getJwtTokenExpiresIn(),
|
|
},
|
|
};
|
|
},
|
|
inject: [EnvironmentService],
|
|
}),
|
|
WorkspaceModule,
|
|
GroupModule,
|
|
],
|
|
controllers: [AuthController],
|
|
providers: [AuthService, SignupService, TokenService, JwtStrategy],
|
|
exports: [TokenService],
|
|
})
|
|
export class AuthModule {}
|