v0.6.15: фикс — switch компаний при имперсонации
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "ipwhitelist",
|
"name": "ipwhitelist",
|
||||||
"version": "0.6.14",
|
"version": "0.6.15",
|
||||||
"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.6.14',
|
version: '0.6.15',
|
||||||
|
|
||||||
// ── 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',
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ function resolveContext(req, res, next) {
|
|||||||
|
|
||||||
// req.email = ТЕКУЩИЙ юзер (имперсонированный или реальный)
|
// req.email = ТЕКУЩИЙ юзер (имперсонированный или реальный)
|
||||||
req.email = email;
|
req.email = email;
|
||||||
req.clientId = isImpersonated ? impersonatedCompanyId : (activeClientId || clientId);
|
req.clientId = isImpersonated ? (activeClientId || impersonatedCompanyId || 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>' +
|
||||||
|
|||||||
Reference in New Issue
Block a user