Skip to content

Commit

Permalink
Encode credentials correctly in login request (fixes #134) (#135)
Browse files Browse the repository at this point in the history
  • Loading branch information
crazyscientist authored Apr 21, 2023
1 parent 0f71329 commit a8b51cd
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions frontend/src/plugins/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -281,11 +281,14 @@ class API {

async login({username, password} = {}) {
const url = `${this.base}/login`;
const body = `username=${username}&password=${password}`;
const body = new URLSearchParams({
username: username,
password: password
});
const response = await this._fetch({
url: url,
method: 'POST',
body: encodeURI(body),
body: body.toString(),
headers: {'Content-Type': 'application/x-www-form-urlencoded'}
});
if (response !== null) {
Expand Down

0 comments on commit a8b51cd

Please sign in to comment.