chore: 升级存在安全风险的依赖
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { Module } from '@nestjs/common';
|
||||
import { JwtModule } from '@nestjs/jwt';
|
||||
import { JwtModule, type JwtModuleOptions } from '@nestjs/jwt';
|
||||
import { ConfigService } from '@nestjs/config';
|
||||
import { APP_GUARD } from '@nestjs/core';
|
||||
import { AuthService } from './auth.service';
|
||||
@@ -14,7 +14,11 @@ import { RolesGuard } from './guards/roles.guard';
|
||||
inject: [ConfigService],
|
||||
useFactory: (config: ConfigService) => ({
|
||||
secret: config.get<string>('jwt.secret'),
|
||||
signOptions: { expiresIn: config.get<string>('jwt.expiresIn') || '7d' },
|
||||
signOptions: {
|
||||
expiresIn:
|
||||
config.get<NonNullable<JwtModuleOptions['signOptions']>['expiresIn']>('jwt.expiresIn') ||
|
||||
'7d',
|
||||
},
|
||||
}),
|
||||
}),
|
||||
],
|
||||
|
||||
@@ -23,7 +23,7 @@ function mountSpa(app: NestExpressApplication, prefix: string, root: string): vo
|
||||
const http = app.getHttpAdapter().getInstance();
|
||||
const index = resolve(root, 'index.html');
|
||||
http.get(prefix, (_req, res) => res.sendFile(index));
|
||||
http.get(`${prefix}/*`, (_req, res) => res.sendFile(index));
|
||||
http.get(`${prefix}/*splat`, (_req, res) => res.sendFile(index));
|
||||
}
|
||||
|
||||
async function bootstrap(): Promise<void> {
|
||||
|
||||
Reference in New Issue
Block a user