fix xhr object auth

Signed-off-by: vladmandic <mandic00@live.com>
This commit is contained in:
vladmandic
2025-12-02 10:59:18 +01:00
parent 39bced0987
commit 44b461cdf7
3 changed files with 19 additions and 8 deletions
+3 -3
View File
@@ -43,9 +43,9 @@ const xhrInternal = async (xhrObj, data, handler = undefined, errorHandler = und
}
};
const { localUser, localToken } = await getToken();
if (localUser && localToken) {
const encoded = btoa(`${localUser}:${localToken}`);
const { user, token } = await getToken();
if (user && token) {
const encoded = btoa(`${user}:${token}`);
xhrObj.setRequestHeader('Authorization', `Basic ${encoded}`);
}