diff --git a/src/components/LoginForm.vue b/src/components/LoginForm.vue index 34377a9..61bcbd1 100644 --- a/src/components/LoginForm.vue +++ b/src/components/LoginForm.vue @@ -14,7 +14,7 @@ dense type="password" /> - + Inloggen @@ -29,10 +29,12 @@ const auth = useFirebaseAuth(); const username = ref(''); const password = ref(''); +const isLoading = ref(false); const emit = defineEmits(['login-success']); const login = () => { + isLoading.value = true; signInWithEmailAndPassword(auth, username.value, password.value) .then((userCredential) => { console.log('User logged-in as: ' + userCredential.user.email); @@ -62,6 +64,9 @@ const login = () => { console.error(`User login failed: ${code} - ${message}`); break; } + }) + .finally(() => { + isLoading.value = false; }); }; diff --git a/src/components/RegisterForm.vue b/src/components/RegisterForm.vue index e5eb59d..2ea1a27 100644 --- a/src/components/RegisterForm.vue +++ b/src/components/RegisterForm.vue @@ -25,7 +25,7 @@ dense type="password" /> - + Registreren @@ -39,10 +39,12 @@ import {useFirebaseAuth, useCurrentUser} from 'vuefire' const auth = useFirebaseAuth(); const username = ref(''); const password = ref(''); +const isLoading = ref(false); const emit = defineEmits(['register-success']); const register = () => { + isLoading.value = true; createUserWithEmailAndPassword(auth, username.value, password.value) .then((userCredential) => { const currentUser = useCurrentUser(); @@ -64,6 +66,9 @@ const register = () => { console.error(`User creation failed: ${code} - ${message}`); break; } + }) + .finally(() => { + isLoading.value = false; }); }; diff --git a/src/components/ResetPasswordAction.vue b/src/components/ResetPasswordAction.vue index afd90f2..9b087bc 100644 --- a/src/components/ResetPasswordAction.vue +++ b/src/components/ResetPasswordAction.vue @@ -57,7 +57,7 @@ const verifyCode = () => { const handleResetPassword = () => { if (newPassword.value !== confirmPassword.value) { - emit('error', 'De ingevoerde wachtwoorden zijn niet hetzelfde.'); + emit('error', 'De ingevoerde wachtwoorden komen niet overeen.'); return; }