From 06fee0eda0f18e534ef18cfce9555c195d6ebff1 Mon Sep 17 00:00:00 2001 From: pypy Date: Sat, 7 Nov 2020 22:09:49 +0900 Subject: [PATCH] bugfix (closes #92) --- html/src/app.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/html/src/app.js b/html/src/app.js index 2c4cbcf2..1baf7fc6 100644 --- a/html/src/app.js +++ b/html/src/app.js @@ -879,11 +879,10 @@ import logWatcherService from './service/logwatcher.js' } */ API.login = function (params) { - var auth = `${params.username}:${params.password}`; - auth = encodeURIComponent(auth); - auth = auth.replace(/%([0-9A-F]{2})/g, (_, s) => String.fromCharCode(parseInt(s, 16))); - auth = auth.replace('%', '%25'); - auth = btoa(auth); + var { username, password } = params; + username = encodeURIComponent(username); + password = encodeURIComponent(password); + var auth = btoa(`${username}:${password}`); return this.call(`auth/user?apiKey=${this.cachedConfig.clientApiKey}`, { method: 'GET', headers: {