corrections after the code review
test-org/trust-module-backend/pipeline/pr-rc This commit looks good
Details
test-org/trust-module-backend/pipeline/pr-rc This commit looks good
Details
parent
918656a5b4
commit
37690dc79f
|
|
@ -50,7 +50,7 @@ export class AuthController {
|
||||||
|
|
||||||
const { access_token } = await this.authService.login(user);
|
const { access_token } = await this.authService.login(user);
|
||||||
|
|
||||||
res.cookie('accecdss_token', access_token, {
|
res.cookie('access_token', access_token, {
|
||||||
httpOnly: true,
|
httpOnly: true,
|
||||||
secure: process.env.COOKIE_SECURE === 'true',
|
secure: process.env.COOKIE_SECURE === 'true',
|
||||||
sameSite: (process.env.COOKIE_SAME_SITE as 'strict' | 'lax' | 'none') || 'strict',
|
sameSite: (process.env.COOKIE_SAME_SITE as 'strict' | 'lax' | 'none') || 'strict',
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ import * as cookieParser from 'cookie-parser';
|
||||||
TypeOrmModule.forFeature([User]),
|
TypeOrmModule.forFeature([User]),
|
||||||
PassportModule,
|
PassportModule,
|
||||||
JwtModule.register({
|
JwtModule.register({
|
||||||
secret: process.env.JWT_SECRET || 'your-secret-key',
|
secret: process.env.JWT_SECRET,
|
||||||
signOptions: { expiresIn: '1h' },
|
signOptions: { expiresIn: '1h' },
|
||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ export class JwtStrategy extends PassportStrategy(Strategy) {
|
||||||
},
|
},
|
||||||
]),
|
]),
|
||||||
ignoreExpiration: false,
|
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 {
|
return {
|
||||||
userId: payload.sub,
|
userId: payload.sub,
|
||||||
username: payload.username,
|
username: payload.username,
|
||||||
login: payload.username // Добавляем для совместимости
|
login: payload.username
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -9,7 +9,7 @@ async function bootstrap() {
|
||||||
|
|
||||||
// Настройка CORS
|
// Настройка CORS
|
||||||
app.enableCors({
|
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,
|
credentials: true,
|
||||||
methods: 'GET,HEAD,PUT,PATCH,POST,DELETE,OPTIONS',
|
methods: 'GET,HEAD,PUT,PATCH,POST,DELETE,OPTIONS',
|
||||||
allowedHeaders: 'Content-Type, Authorization, X-Requested-With',
|
allowedHeaders: 'Content-Type, Authorization, X-Requested-With',
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue