55 lines
1.2 KiB
Vue
55 lines
1.2 KiB
Vue
<script setup lang="ts">
|
|
definePageMeta({
|
|
layout: "notLoggedIn"
|
|
})
|
|
|
|
const auth = useAuthStore()
|
|
const toast = useToast()
|
|
|
|
|
|
|
|
|
|
const doReset = async (data:any) => {
|
|
try {
|
|
const res = await useNuxtApp().$api("/auth/password/reset", {
|
|
method: "POST",
|
|
body: {
|
|
email: data.email
|
|
}
|
|
})
|
|
|
|
// Weiterleiten nach erfolgreichem Login
|
|
toast.add({title:"Zurücksetzen erfolgreich"})
|
|
return navigateTo("/login")
|
|
} catch (err: any) {
|
|
toast.add({title:"Problem beim zurücksetzen",color:"rose"})
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<template>
|
|
<UCard class="max-w-sm w-full mx-auto mt-5">
|
|
|
|
<UColorModeImage
|
|
light="/Logo.png"
|
|
dark="/Logo_Dark.png"
|
|
/>
|
|
|
|
<UAuthForm
|
|
title="Passwort zurücksetzen"
|
|
description="Geben Sie Ihre E-Mail ein um ein neues Passwort per E-Mail zu erhalten."
|
|
align="bottom"
|
|
:fields="[{
|
|
name: 'email',
|
|
type: 'text',
|
|
label: 'Email',
|
|
placeholder: 'Deine E-Mail Adresse'
|
|
}]"
|
|
:loading="false"
|
|
@submit="doReset"
|
|
:submit-button="{label: 'Zurücksetzen'}"
|
|
divider="oder"
|
|
>
|
|
</UAuthForm>
|
|
</UCard>
|
|
</template> |