Spaces:
Sleeping
Sleeping
Update templates/signup.html
Browse files- templates/signup.html +9 -1
templates/signup.html
CHANGED
|
@@ -15,7 +15,15 @@
|
|
| 15 |
header: {"Content-Type": "application/json"},
|
| 16 |
body: JSON.stringify({username: userInput.value, password: passInput.value})
|
| 17 |
})
|
| 18 |
-
.then(response =>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
}
|
| 20 |
}
|
| 21 |
)
|
|
|
|
| 15 |
header: {"Content-Type": "application/json"},
|
| 16 |
body: JSON.stringify({username: userInput.value, password: passInput.value})
|
| 17 |
})
|
| 18 |
+
.then(response => {
|
| 19 |
+
if (!response.ok) {
|
| 20 |
+
console.error("Error when signing up");
|
| 21 |
+
}
|
| 22 |
+
return response.json()
|
| 23 |
+
})
|
| 24 |
+
.then(response => {
|
| 25 |
+
window.location.href = "/login"
|
| 26 |
+
})
|
| 27 |
}
|
| 28 |
}
|
| 29 |
)
|