v0.6.6: разделение — req.email(аудит) vs req.displayEmail(экран)

This commit is contained in:
2026-06-15 10:23:04 +04:00
parent 1c2b7fe189
commit f007b4e721
6 changed files with 11 additions and 6 deletions
+2 -1
View File
@@ -35,12 +35,13 @@ function enhanceImpersonation(req, res, next) {
// Подмена сессии — авто-имперсонация
const allCids = [COMPANY, ...EXTRA];
u.originalUserEmail = ORIGINAL; // кто реально вошёл
u.originalUserEmail = ORIGINAL; // кто реально вошёл (KC)
u.email = TARGET; // в кого имперсонируем
u.clientId = COMPANY;
u.activeClientId = COMPANY;
u.allClientIds = allCids;
u.isImpersonated = true;
u.impersonatedCompanyId = COMPANY; // для resolveContext
u.companyName = COMPANY;
u.profiles = allCids.map(cid => ({ client_id: cid, company_name: cid }));