prettier fixes #16

This commit is contained in:
Michael Dausmann
2023-10-24 21:18:03 +11:00
parent dc9d64ebf5
commit a7f8c37f99
56 changed files with 1706 additions and 935 deletions

View File

@@ -3,27 +3,27 @@
const notifyStore = useNotifyStore();
const loading = ref(false)
const password = ref('')
const confirmPassword = ref('')
const loading = ref(false);
const password = ref('');
const confirmPassword = ref('');
const changePassword = async () => {
try {
loading.value = true
loading.value = true;
const { data, error } = await supabase.auth.updateUser({
password: password.value
});
if (error) throw error
if (error) throw error;
else {
notifyStore.notify("password changed", NotificationType.Success);
navigateTo('/signin', {replace: true}); // navigate to signin because it is best practice although the auth session seems to be valid so it immediately redirects to dashboard
notifyStore.notify('password changed', NotificationType.Success);
navigateTo('/signin', { replace: true }); // navigate to signin because it is best practice although the auth session seems to be valid so it immediately redirects to dashboard
}
} catch (error) {
notifyStore.notify(error, NotificationType.Error);
} finally {
loading.value = false
loading.value = false;
}
}
};
</script>
<template>
<div class="flex flex-col items-center justify-center h-screen bg-gray-100">
@@ -31,17 +31,35 @@
<h1 class="text-3xl font-bold text-center">Forgot Pasword</h1>
<form @submit.prevent="changePassword" class="space-y-4">
<div>
<label for="password" class="block mb-2 font-bold">New Password</label>
<input v-model="password" id="password" type="password" class="w-full p-2 border border-gray-400 rounded-md"
placeholder="Enter your new password" required>
<label for="password" class="block mb-2 font-bold"
>New Password</label
>
<input
v-model="password"
id="password"
type="password"
class="w-full p-2 border border-gray-400 rounded-md"
placeholder="Enter your new password"
required />
</div>
<div>
<label for="confirmPassword" class="block mb-2 font-bold">Confirm New Password</label>
<input v-model="confirmPassword" id="confirmPassword" type="password" class="w-full p-2 border border-gray-400 rounded-md"
placeholder="Confirm new password" required>
<label for="confirmPassword" class="block mb-2 font-bold"
>Confirm New Password</label
>
<input
v-model="confirmPassword"
id="confirmPassword"
type="password"
class="w-full p-2 border border-gray-400 rounded-md"
placeholder="Confirm new password"
required />
</div>
<button :disabled="loading || password === '' || (confirmPassword !== password)" type="submit"
class="w-full py-2 text-white bg-indigo-600 rounded-md hover:bg-indigo-700">Change Password</button>
<button
:disabled="loading || password === '' || confirmPassword !== password"
type="submit"
class="w-full py-2 text-white bg-indigo-600 rounded-md hover:bg-indigo-700">
Change Password
</button>
</form>
</div>
</div>