mirror of
https://github.com/vvsviridov/enm-cli.git
synced 2025-10-23 00:12:23 +00:00
FIX: passwords with special characters
This commit is contained in:
@@ -4,19 +4,21 @@ const webSocketSession = require('./webSocketSession')
|
|||||||
class ENM {
|
class ENM {
|
||||||
constructor(username, password, url) {
|
constructor(username, password, url) {
|
||||||
this.logoutUrl = '/logout'
|
this.logoutUrl = '/logout'
|
||||||
this.loginUrl = encodeURI(`/login?IDToken1=${username}&IDToken2=${password}`)
|
this.loginUrl = '/login'
|
||||||
this.commands = []
|
this.commands = []
|
||||||
this.choices = []
|
this.choices = []
|
||||||
this.httpClient = axiosHttpClient(url)
|
this.httpClient = axiosHttpClient(url)
|
||||||
this.url = url
|
this.url = url
|
||||||
this.username = username
|
this.username = username
|
||||||
|
this.password = password
|
||||||
}
|
}
|
||||||
|
|
||||||
async login() {
|
async login() {
|
||||||
const axiosConfig = {
|
const axiosConfig = {
|
||||||
text: 'Login in...',
|
text: 'Login in...',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
url: this.loginUrl
|
url: this.loginUrl,
|
||||||
|
data: `IDToken1=${encodeURIComponent(this.username)}&IDToken2=${encodeURIComponent(this.password)}`,
|
||||||
}
|
}
|
||||||
const response = await this.httpClient.request(axiosConfig)
|
const response = await this.httpClient.request(axiosConfig)
|
||||||
return response.data
|
return response.data
|
||||||
|
Reference in New Issue
Block a user