From b1b61963fc753e6cfa82861586e7d4e16d9a613d Mon Sep 17 00:00:00 2001 From: Yuri Kuznetsov Date: Thu, 21 Sep 2023 11:20:10 +0300 Subject: [PATCH] login headers fix --- client/src/app.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/client/src/app.js b/client/src/app.js index 43cfa3bac9..d586957f7d 100644 --- a/client/src/app.js +++ b/client/src/app.js @@ -1064,15 +1064,16 @@ class App { setupAjax() { /** * @param {XMLHttpRequest} xhr + * @param {Object.} options */ - const beforeSend = (xhr) => { - if (this.auth !== null) { + const beforeSend = (xhr, options) => { + if (this.auth !== null && !options.login) { xhr.setRequestHeader('Authorization', 'Basic ' + this.auth); xhr.setRequestHeader('Espo-Authorization', this.auth); xhr.setRequestHeader('Espo-Authorization-By-Token', 'true'); } - if (this.anotherUser !== null) { + if (this.anotherUser !== null && !options.login) { xhr.setRequestHeader('X-Another-User', this.anotherUser); } };