summaryrefslogtreecommitdiff
path: root/pse-dashboard/src/views/ForgotPasswordView.vue
blob: 03d0ff1e47712c2b13aa401935597ee8c3b53220 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<script setup>
import { FloatingLabelInput, FormLayout } from '@/components'
import { useLogger } from '@/logger.js'
import { ref } from 'vue'
import { forgotPassword } from '@/api/pse-squared.js'

const email = ref("");

const { passwordForgot } = useLogger();

async function formForgot() {
    try {
        await forgotPassword({ email: email.value });
        passwordForgot();
    } catch (err) {}
}
</script>
<template>
    <FormLayout>
        <!-- Text über Texteingabefeld -->
        <h1 class="h3 mb-3 fw-normal">
            {{ $t("message.emailAddressRequest") }}
        </h1>

        <form @submit.prevent="formForgot">
            <!-- Eingabefeld für E-Mail-Adresse -->
            <FloatingLabelInput
                v-model="email"
                type="email"
                :label="$t('form.emailAddress')"
            />
    
            <!-- Absende Knopf der Daten -->
            <button
                type="submit"
                class="w-100 btn btn-lg btn-primary mt-2"
            >
                {{ $t("message.send") }}
            </button>
        </form>

        <!-- Zurück zur Anmeldung -->
        <router-link to="/">
            <button class="w-100 btn btn-lg btn-secondary mt-2">
                {{ $t("message.close") }}
            </button>
        </router-link>
    </FormLayout>
</template>
<style scoped>
</style>