v0.6.16: req.clientId = activeClientId — без условий, CRUD не знает про имперсонацию

This commit is contained in:
2026-06-15 11:09:44 +04:00
parent 9854932f50
commit b2480b8aac
3 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "ipwhitelist", "name": "ipwhitelist",
"version": "0.6.15", "version": "0.6.16",
"description": "IP WhiteList microservice for cloud provider", "description": "IP WhiteList microservice for cloud provider",
"main": "server.js", "main": "server.js",
"scripts": { "scripts": {
+1 -1
View File
@@ -9,7 +9,7 @@
// ═══════════════════════════════════════════════════════════════════════════════ // ═══════════════════════════════════════════════════════════════════════════════
module.exports = { module.exports = {
version: '0.6.15', version: '0.6.16',
// ── IAM ────────────────────────────────────────────────────────────────── // ── IAM ──────────────────────────────────────────────────────────────────
iamUrl: process.env.V2_IAM_URL || 'https://auth-api.ngcloud.ru/api/v1/auth/user', iamUrl: process.env.V2_IAM_URL || 'https://auth-api.ngcloud.ru/api/v1/auth/user',
+1 -1
View File
@@ -54,7 +54,7 @@ function resolveContext(req, res, next) {
// req.email = ТЕКУЩИЙ юзер (имперсонированный или реальный) // req.email = ТЕКУЩИЙ юзер (имперсонированный или реальный)
req.email = email; req.email = email;
req.clientId = isImpersonated ? (activeClientId || impersonatedCompanyId || clientId) : (activeClientId || clientId); req.clientId = activeClientId || clientId;
if (!req.clientId) return res.status(400).send( if (!req.clientId) return res.status(400).send(
'<h2>Ошибка</h2><p>Не удалось определить W-номер компании.</p>' + '<h2>Ошибка</h2><p>Не удалось определить W-номер компании.</p>' +
'<p><b>req.clientId:</b> «' + String(req.clientId) + '» (type: ' + typeof req.clientId + ', len: ' + String(req.clientId).length + ')</p>' + '<p><b>req.clientId:</b> «' + String(req.clientId) + '» (type: ' + typeof req.clientId + ', len: ' + String(req.clientId).length + ')</p>' +