prettier fixes #16
This commit is contained in:
@@ -3,23 +3,30 @@
|
||||
const config = useRuntimeConfig();
|
||||
const notifyStore = useNotifyStore();
|
||||
|
||||
const loading = ref(false)
|
||||
const email = ref('')
|
||||
const loading = ref(false);
|
||||
const email = ref('');
|
||||
|
||||
const sendResetPasswordLink = async () => {
|
||||
try {
|
||||
loading.value = true
|
||||
const { data, error } = await supabase.auth.resetPasswordForEmail(email.value, {
|
||||
redirectTo: `${config.public.siteRootUrl}/resetpassword`,
|
||||
})
|
||||
if (error) throw error
|
||||
else notifyStore.notify("Password Reset link sent, check your email.", NotificationType.Success);
|
||||
loading.value = true;
|
||||
const { data, error } = await supabase.auth.resetPasswordForEmail(
|
||||
email.value,
|
||||
{
|
||||
redirectTo: `${config.public.siteRootUrl}/resetpassword`
|
||||
}
|
||||
);
|
||||
if (error) throw error;
|
||||
else
|
||||
notifyStore.notify(
|
||||
'Password Reset link sent, check your email.',
|
||||
NotificationType.Success
|
||||
);
|
||||
} 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">
|
||||
@@ -28,11 +35,20 @@
|
||||
<form @submit.prevent="sendResetPasswordLink" class="space-y-4">
|
||||
<div>
|
||||
<label for="email" class="block mb-2 font-bold">Email</label>
|
||||
<input v-model="email" id="email" type="email" class="w-full p-2 border border-gray-400 rounded-md"
|
||||
placeholder="Enter your email" required>
|
||||
<input
|
||||
v-model="email"
|
||||
id="email"
|
||||
type="email"
|
||||
class="w-full p-2 border border-gray-400 rounded-md"
|
||||
placeholder="Enter your email"
|
||||
required />
|
||||
</div>
|
||||
<button :disabled="loading || email === ''" type="submit"
|
||||
class="w-full py-2 text-white bg-indigo-600 rounded-md hover:bg-indigo-700">Send Reset Password Link</button>
|
||||
<button
|
||||
:disabled="loading || email === ''"
|
||||
type="submit"
|
||||
class="w-full py-2 text-white bg-indigo-600 rounded-md hover:bg-indigo-700">
|
||||
Send Reset Password Link
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user