Commit d9e0b636 authored by Stanislav's avatar Stanislav Committed by JC Brand

Fix: use JID from credentials when credentials_url is set (#1638)

* Fix: async SetUserJID
parent 643c40f2
...@@ -671,10 +671,11 @@ function fetchLoginCredentials (wait=0) { ...@@ -671,10 +671,11 @@ function fetchLoginCredentials (wait=0) {
xhr.onload = () => { xhr.onload = () => {
if (xhr.status >= 200 && xhr.status < 400) { if (xhr.status >= 200 && xhr.status < 400) {
const data = JSON.parse(xhr.responseText); const data = JSON.parse(xhr.responseText);
setUserJID(data.jid); setUserJID(data.jid).then(() => {
resolve({ resolve({
jid: data.jid, jid: data.jid,
password: data.password password: data.password
});
}); });
} else { } else {
reject(new Error(`${xhr.status}: ${xhr.responseText}`)); reject(new Error(`${xhr.status}: ${xhr.responseText}`));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment