From be6884079925964dd6fc701e40cb7fa4fed436e4 Mon Sep 17 00:00:00 2001 From: CodeNamedRobin Date: Thu, 3 Aug 2023 11:46:02 +0200 Subject: [PATCH 1/3] Fixed form for login - Now when pressing enter it works! --- package.json | 1 + src/views/LoginView.vue | 25 +++++++++++++++++-------- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index a8545589..a01b8c83 100644 --- a/package.json +++ b/package.json @@ -21,6 +21,7 @@ "sass": "^1.63.6", "stripe": "^12.14.0", "uuid": "^9.0.0", + "vee-validate": "^4.11.1", "vue": "^3.3.4", "vue-router": "^4.2.2" }, diff --git a/src/views/LoginView.vue b/src/views/LoginView.vue index 43a5eaa1..571915ee 100644 --- a/src/views/LoginView.vue +++ b/src/views/LoginView.vue @@ -5,11 +5,14 @@

SudoSOS Login


- - - - - +
+ + + + + + + Reset password (External accounts only) @@ -28,11 +31,12 @@ import router from "@/router"; const authStore = useAuthStore(); const userStore = useUserStore(); +const username = ref(""); +const password = ref(""); -const username = ref(''); -const password = ref(''); const route = useRoute(); + onBeforeMount(() => { if (route.query.token !== undefined) { const token = route.query.token as string; @@ -44,7 +48,8 @@ onBeforeMount(() => { } }) -const ldapLogin = async () => { +const ldapLogin = async (event: Event) => { + event.preventDefault(); await authStore.gewisLdapLogin(username.value, password.value, apiService).then(() => { if (authStore.getUser) userStore.fetchCurrentUserBalance(authStore.getUser.id, apiService); router.push({name: 'home'}) @@ -60,6 +65,10 @@ const loginViaGEWIS = () => {