This commit is contained in:
Timo Hocker 2020-03-06 08:25:03 +01:00
parent 37969f65cb
commit d5a0207af9

View File

@ -23,11 +23,11 @@ const fetch = require ('node-fetch');
*/
async function login (user, password, host = '') {
const salt_str = await fetch (`${host}/auth`, { headers: { user } })
.then ((res) => {
.then (async (res) => {
if (res.status !== http_consts.status_ok)
return new Promise ((resolve) => resolve (''));
return '');
return res.text ();
return await res.text ();
});
if (salt_str === '')