FIX: passwords with special characters

This commit is contained in:
Vyacheslav.Sviridov
2024-09-10 18:19:12 +06:00
parent f9bc96ffd2
commit 40834be2d9

View File

@@ -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