[Fix] Properly escape password

This commit is contained in:
Robert von Burg 2019-03-13 20:17:33 +01:00
parent 9c8d34a076
commit 05735b2a76
2 changed files with 3 additions and 5 deletions

View File

@ -1,7 +1,7 @@
{ {
"name": "strolch-wc-auth", "name": "strolch-wc-auth",
"description": "Strolch WebComponent Auth", "description": "Strolch WebComponent Auth",
"version": "0.7.0", "version": "0.7.1",
"authors": ["Robert von Burg"], "authors": ["Robert von Burg"],
"keywords": [ "keywords": [
"strolch", "strolch",

View File

@ -317,8 +317,7 @@
this.dlgTitle = this.localize('authenticationFailed'); this.dlgTitle = this.localize('authenticationFailed');
this.$.ajaxAuth.body = { this.$.ajaxAuth.body = {
'username': this.username, 'username': this.username,
'password': btoa(this.password), 'password': btoa(unescape(encodeURIComponent(this.password)))
'encoding': this.passwordEncoding
}; };
this.$.ajaxAuth.url = this.basePath + 'rest/strolch/authentication'; this.$.ajaxAuth.url = this.basePath + 'rest/strolch/authentication';
this.$.ajaxAuth.method = 'POST'; this.$.ajaxAuth.method = 'POST';
@ -419,8 +418,7 @@
this.$.ajaxAuth.url = this.basePath + 'rest/strolch/privilege/users/' + this.username + '/password'; this.$.ajaxAuth.url = this.basePath + 'rest/strolch/privilege/users/' + this.username + '/password';
this.$.ajaxAuth.method = 'PUT'; this.$.ajaxAuth.method = 'PUT';
this.$.ajaxAuth.body = { this.$.ajaxAuth.body = {
'password': btoa(this.password1), 'password': btoa(unescape(encodeURIComponent(this.password1)))
'encoding': this.passwordEncoding
}; };
this.$.ajaxAuth.generateRequest(); this.$.ajaxAuth.generateRequest();
}, },