This commit is contained in:
Mashy
2019-07-19 19:19:29 +10:00
parent 7eb34b4350
commit 51d3c76460
2 changed files with 26 additions and 6 deletions
+3 -5
View File
@@ -12,11 +12,9 @@ const addState = connect(
} = state;
function submitLogin(name, password) {
postData('/login', { name, password })
.then(res => {
if (!res.ok) return errorToast(res);
res.text()
})
.then(res => {
.then(res => res.json())
.then(data => {
if (!data.success) return errorToast(data.error_message);
ws.connect();
})
.catch(error => errorToast(error));