diff --git a/package.json b/package.json index a88dcb1..ddb5729 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ipwhitelist", - "version": "0.5.120", + "version": "0.5.121", "description": "IP WhiteList microservice for cloud provider", "main": "server.js", "scripts": { diff --git a/v2/src/config/index.js b/v2/src/config/index.js index fb8476c..31139ff 100644 --- a/v2/src/config/index.js +++ b/v2/src/config/index.js @@ -9,7 +9,7 @@ // ═══════════════════════════════════════════════════════════════════════════════ module.exports = { - version: '0.5.120', + version: '0.5.121', // ── IAM ────────────────────────────────────────────────────────────────── iamUrl: process.env.V2_IAM_URL || 'https://auth-api.ngcloud.ru/api/v1/auth/user', diff --git a/v2/src/router/index.js b/v2/src/router/index.js index 0864fd6..dea60a6 100644 --- a/v2/src/router/index.js +++ b/v2/src/router/index.js @@ -38,10 +38,7 @@ function resolveContext(req, res, next) { const isImpersonated = !!(u.originalUserEmail && u.impersonatedCompanyId); req.email = u.email || ''; - // activeClientId может переопределять impersonatedCompanyId при switchTo - req.clientId = isImpersonated - ? (u.activeClientId || u.impersonatedCompanyId || u.clientId || '') - : (u.activeClientId || u.clientId || ''); + req.clientId = u.activeClientId || u.clientId || ''; req.companyName = u.companyName || req.clientId; // Админ: пользователь с WZ01112 — всегда админ const allCids = u.allClientIds || [u.clientId || '']; diff --git a/v2/src/user/index.js b/v2/src/user/index.js index e150f9a..43da3ae 100644 --- a/v2/src/user/index.js +++ b/v2/src/user/index.js @@ -33,7 +33,6 @@ function createUserRouter() { const targetId = req.query.switchTo; if (isAdmin) { req.session.user.activeClientId = targetId; - if (req.session.user.isImpersonated) req.session.user.impersonatedCompanyId = targetId; return res.redirect('/v2/app'); } else { const allowed = (req.profiles || []).find(p => p.client_id === targetId);