login headers fix

This commit is contained in:
Yuri Kuznetsov
2023-09-21 11:20:10 +03:00
parent 5282f01cda
commit b1b61963fc
+4 -3
View File
@@ -1064,15 +1064,16 @@ class App {
setupAjax() {
/**
* @param {XMLHttpRequest} xhr
* @param {Object.<string, *>} 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);
}
};