From d5a0207af9d0b9e51cc0da5c7cf934e41f02a5a3 Mon Sep 17 00:00:00 2001 From: Timo Hocker Date: Fri, 6 Mar 2020 08:25:03 +0100 Subject: [PATCH] fix --- index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index fae2fb0..dfdcabd 100644 --- a/index.js +++ b/index.js @@ -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 === '')