diff --git a/src/components/FormComponents/RegisterForm.vue b/src/components/FormComponents/RegisterForm.vue index 240895bffbe2fe98be228f19e2d7549f3bc24227..3f4551a3e677e01b48cfcc29cb889b21d9bf04c1 100644 --- a/src/components/FormComponents/RegisterForm.vue +++ b/src/components/FormComponents/RegisterForm.vue @@ -182,15 +182,15 @@ export default { const loginResponse = await doLogin(loginRequest); - if (loginResponse === "Failed login") { + if (loginResponse.isLoggedIn === false) { this.errorMessage = "Failed to log in with new user"; this.$store.commit("logout"); - this.$router.push("/login"); + await this.$router.push("/login"); return; } - this.$store.commit("saveToken", loginResponse); - this.$router.push("/"); + this.$store.commit("saveToken", loginResponse.token); + await this.$router.push("/"); }, async sendRegisterRequest() { const registerInfo = {