mirror of
https://github.com/docmost/docmost.git
synced 2026-05-13 02:34:05 +08:00
eefe63d1cd
* fix comments on the frontend * move jwt token service to its own module * other fixes and updates
25 lines
713 B
TypeScript
25 lines
713 B
TypeScript
import { Module } from '@nestjs/common';
|
|
import { JwtModule } from '@nestjs/jwt';
|
|
import { EnvironmentService } from '../../integrations/environment/environment.service';
|
|
import { TokenService } from './services/token.service';
|
|
|
|
@Module({
|
|
imports: [
|
|
JwtModule.registerAsync({
|
|
useFactory: async (environmentService: EnvironmentService) => {
|
|
return {
|
|
secret: environmentService.getAppSecret(),
|
|
signOptions: {
|
|
expiresIn: environmentService.getJwtTokenExpiresIn(),
|
|
issuer: 'Docmost',
|
|
},
|
|
};
|
|
},
|
|
inject: [EnvironmentService],
|
|
}),
|
|
],
|
|
providers: [TokenService],
|
|
exports: [TokenService],
|
|
})
|
|
export class TokenModule {}
|