Fix registration not displaying #14

Merged
jacob1123 merged 5 commits from registration into master 2022-02-22 14:44:29 +01:00
3 changed files with 49 additions and 64 deletions
Showing only changes of commit ffabf1bca9 - Show all commits

View File

@ -5,6 +5,7 @@ import { useSessionStore } from "../stores/session";
const error = ref("");
const login = ref({ email: "", password: "", name: "" });
const router = useRouter(); // has to be called in setup
onMounted(() => {
useSessionStore().setTitle("Login");
@ -15,7 +16,8 @@ function formSubmit(e: MouseEvent) {
useSessionStore().register(login.value)
.then(x => {
error.value = "";
useRouter().replace("/dashboard");
router.replace("/dashboard");
return x;
})
.catch(x => error.value = "The entered credentials are invalid!");