use application/json for login and logout

This commit is contained in:
Scott Lamb
2020-01-08 23:23:58 -08:00
parent 8af7bca6c2
commit 73f7cdd261
4 changed files with 36 additions and 63 deletions

View File

@@ -168,10 +168,11 @@ export default class MoonfireAPI {
*/
login(username, password) {
return $.ajax(this._builder.makeUrl('login'), {
data: {
data: JSON.stringify({
username: username,
password: password,
},
}),
contentType: 'application/json',
method: 'POST',
});
}
@@ -185,9 +186,10 @@ export default class MoonfireAPI {
*/
logout(csrf) {
return $.ajax(this._builder.makeUrl('logout'), {
data: {
data: JSON.stringify({
csrf: csrf,
},
}),
contentType: 'application/json',
method: 'POST',
});
}