From 85a304b2e829a3acef21501772379dc64fb3aa6c Mon Sep 17 00:00:00 2001 From: Amir Raminfar Date: Fri, 13 Dec 2024 16:20:48 -0800 Subject: [PATCH 1/3] feat: adds small loader while logging in --- assets/pages/login.vue | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/assets/pages/login.vue b/assets/pages/login.vue index 6d644ab0257b..2fd3ef8f168e 100644 --- a/assets/pages/login.vue +++ b/assets/pages/login.vue @@ -12,6 +12,7 @@ autocomplete="username" autofocus required + :disabled="loading" /> - + @@ -42,10 +47,12 @@ const { t } = useI18n(); setTitle(t("title.login")); const error = ref(false); +const loading = ref(false); const form = ref(); const params = new URLSearchParams(window.location.search); async function onLogin() { + loading.value = true; const response = await fetch(withBase("/api/token"), { body: new FormData(form.value), method: "POST", @@ -61,6 +68,7 @@ async function onLogin() { } else { error.value = true; } + loading.value = false; } From 92c60b29bd352686e557fe931edcf7cbde3b4160 Mon Sep 17 00:00:00 2001 From: Amir Raminfar Date: Fri, 13 Dec 2024 17:20:05 -0800 Subject: [PATCH 2/3] makes error better --- assets/pages/login.vue | 62 ++++++++++++++++++++++++------------------ 1 file changed, 35 insertions(+), 27 deletions(-) diff --git a/assets/pages/login.vue b/assets/pages/login.vue index 2fd3ef8f168e..9403a86eec8e 100644 --- a/assets/pages/login.vue +++ b/assets/pages/login.vue @@ -2,34 +2,42 @@
-