corrections after the code review
test-org/trust-module-backend/pipeline/pr-rc This commit looks good Details

pull/16/head
DmitriyA 2025-04-21 09:39:03 -04:00
parent 918656a5b4
commit 37690dc79f
4 changed files with 5 additions and 5 deletions

View File

@ -50,7 +50,7 @@ export class AuthController {
const { access_token } = await this.authService.login(user);
res.cookie('accecdss_token', access_token, {
res.cookie('access_token', access_token, {
httpOnly: true,
secure: process.env.COOKIE_SECURE === 'true',
sameSite: (process.env.COOKIE_SAME_SITE as 'strict' | 'lax' | 'none') || 'strict',

View File

@ -13,7 +13,7 @@ import * as cookieParser from 'cookie-parser';
TypeOrmModule.forFeature([User]),
PassportModule,
JwtModule.register({
secret: process.env.JWT_SECRET || 'your-secret-key',
secret: process.env.JWT_SECRET,
signOptions: { expiresIn: '1h' },
}),
],

View File

@ -14,7 +14,7 @@ export class JwtStrategy extends PassportStrategy(Strategy) {
},
]),
ignoreExpiration: false,
secretOrKey: process.env.JWT_SECRET || 'your-secret-key',
secretOrKey: process.env.JWT_SECRET,
});
}
@ -22,7 +22,7 @@ export class JwtStrategy extends PassportStrategy(Strategy) {
return {
userId: payload.sub,
username: payload.username,
login: payload.username // Добавляем для совместимости
login: payload.username
};
}
}

View File

@ -9,7 +9,7 @@ async function bootstrap() {
// Настройка CORS
app.enableCors({
origin: [process.env.FRONTEND_URL, "http://dev.msf.enode"], //|| 'http://192.168.2.39:5173', // Точный URL фронтенда
origin: [process.env.FRONTEND_URL, "http://dev.msf.enode"],
credentials: true,
methods: 'GET,HEAD,PUT,PATCH,POST,DELETE,OPTIONS',
allowedHeaders: 'Content-Type, Authorization, X-Requested-With',