Fix #322: German umlauts create mistakes when using them in passwords
See https://stackoverflow.com/questions/3626183/javascript-base64-encoding-utf8-string-fails-in-webkit-safari
This commit is contained in:
parent
fbe321228a
commit
7d1cdb0536
@ -28,7 +28,7 @@ export function login(username: String, password: String) {
|
|||||||
method: 'GET',
|
method: 'GET',
|
||||||
headers: {
|
headers: {
|
||||||
'X-Requested-With': 'XMLHttpRequest',
|
'X-Requested-With': 'XMLHttpRequest',
|
||||||
'Authorization': 'Basic ' + window.btoa(username + ':' + password)
|
'Authorization': 'Basic ' + btoa(unescape(encodeURIComponent(username + ':' + password))),
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -39,7 +39,7 @@ export function login(username: String, password: String) {
|
|||||||
if (retVal) {
|
if (retVal) {
|
||||||
// store user details and basic auth credentials in local storage
|
// store user details and basic auth credentials in local storage
|
||||||
// to keep user logged in between page refreshes
|
// to keep user logged in between page refreshes
|
||||||
retVal.authdata = window.btoa(username + ':' + password);
|
retVal.authdata = btoa(unescape(encodeURIComponent(username + ':' + password)));
|
||||||
localStorage.setItem('user', JSON.stringify(retVal));
|
localStorage.setItem('user', JSON.stringify(retVal));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user