v0.5.117: при имперсонации email в UI от таргета, не от админа
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "ipwhitelist",
|
"name": "ipwhitelist",
|
||||||
"version": "0.5.116",
|
"version": "0.5.117",
|
||||||
"description": "IP WhiteList microservice for cloud provider",
|
"description": "IP WhiteList microservice for cloud provider",
|
||||||
"main": "server.js",
|
"main": "server.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
// ═══════════════════════════════════════════════════════════════════════════════
|
// ═══════════════════════════════════════════════════════════════════════════════
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
version: '0.5.116',
|
version: '0.5.117',
|
||||||
|
|
||||||
// ── 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',
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ function resolveContext(req, res, next) {
|
|||||||
// u.impersonatedCompanyId — W-номер компании
|
// u.impersonatedCompanyId — W-номер компании
|
||||||
const isImpersonated = !!(u.originalUserEmail && u.impersonatedCompanyId);
|
const isImpersonated = !!(u.originalUserEmail && u.impersonatedCompanyId);
|
||||||
|
|
||||||
req.email = isImpersonated ? u.originalUserEmail : (u.email || '');
|
req.email = u.email || '';
|
||||||
req.clientId = isImpersonated ? u.impersonatedCompanyId : (u.activeClientId || u.clientId || '');
|
req.clientId = isImpersonated ? u.impersonatedCompanyId : (u.activeClientId || u.clientId || '');
|
||||||
req.companyName = u.companyName || req.clientId;
|
req.companyName = u.companyName || req.clientId;
|
||||||
// Админ: пользователь с WZ01112 — всегда админ
|
// Админ: пользователь с WZ01112 — всегда админ
|
||||||
|
|||||||
Reference in New Issue
Block a user