fix
This commit is contained in:
parent
37969f65cb
commit
d5a0207af9
6
index.js
6
index.js
@ -23,11 +23,11 @@ const fetch = require ('node-fetch');
|
|||||||
*/
|
*/
|
||||||
async function login (user, password, host = '') {
|
async function login (user, password, host = '') {
|
||||||
const salt_str = await fetch (`${host}/auth`, { headers: { user } })
|
const salt_str = await fetch (`${host}/auth`, { headers: { user } })
|
||||||
.then ((res) => {
|
.then (async (res) => {
|
||||||
if (res.status !== http_consts.status_ok)
|
if (res.status !== http_consts.status_ok)
|
||||||
return new Promise ((resolve) => resolve (''));
|
return '');
|
||||||
|
|
||||||
return res.text ();
|
return await res.text ();
|
||||||
});
|
});
|
||||||
|
|
||||||
if (salt_str === '')
|
if (salt_str === '')
|
||||||
|
Reference in New Issue
Block a user