From 40834be2d9c12e7d5ff5b583f024dd8da6287834 Mon Sep 17 00:00:00 2001 From: "Vyacheslav.Sviridov" Date: Tue, 10 Sep 2024 18:19:12 +0600 Subject: [PATCH] FIX: passwords with special characters --- lib/components/ENM.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/components/ENM.js b/lib/components/ENM.js index 0155a0a..aae5973 100755 --- a/lib/components/ENM.js +++ b/lib/components/ENM.js @@ -4,19 +4,21 @@ const webSocketSession = require('./webSocketSession') class ENM { constructor(username, password, url) { this.logoutUrl = '/logout' - this.loginUrl = encodeURI(`/login?IDToken1=${username}&IDToken2=${password}`) + this.loginUrl = '/login' this.commands = [] this.choices = [] this.httpClient = axiosHttpClient(url) this.url = url this.username = username + this.password = password } async login() { const axiosConfig = { text: 'Login in...', method: 'post', - url: this.loginUrl + url: this.loginUrl, + data: `IDToken1=${encodeURIComponent(this.username)}&IDToken2=${encodeURIComponent(this.password)}`, } const response = await this.httpClient.request(axiosConfig) return response.data