2021-04-21 10:33:16 +00:00
|
|
|
<template>
|
|
|
|
<div class="min-h-screen flex items-center justify-center">
|
|
|
|
<div class="max-w-md w-full py-12 px-6">
|
|
|
|
<img class="mx-auto h-24 w-auto" src="/favicon.png" alt />
|
|
|
|
<h1
|
|
|
|
class="sm:text-3xl text-2xl font-medium title-font mb-4 text-center"
|
|
|
|
>Lauf für Kaya! - {{ $t('profile') }}</h1>
|
|
|
|
<p class="mx-auto leading-relaxed text-base text-center">
|
|
|
|
{{ $t('you_have_not_provided_a_valid_access_key') }}
|
|
|
|
<br />
|
|
|
|
{{ $t('access_is_only_provided_via_your_email_link') }}
|
|
|
|
</p>
|
|
|
|
<div class="mt-6">
|
|
|
|
<div class="relative">
|
|
|
|
<div class="absolute inset-0 flex items-center">
|
|
|
|
<div class="w-full border-t border-gray-300"></div>
|
|
|
|
</div>
|
|
|
|
<div class="relative flex justify-center text-sm">
|
|
|
|
<span
|
|
|
|
class="px-2 bg-white dark:bg-gray-900"
|
|
|
|
>{{ $t('lost_your_registration_mail') }}</span>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="mt-4">
|
|
|
|
<label for="email_address" class="block font-medium">
|
|
|
|
{{ $t('e_mail_adress') }}
|
|
|
|
<span class="font-bold">*</span>
|
|
|
|
</label>
|
|
|
|
<input
|
|
|
|
v-model="user_email"
|
|
|
|
name="email_address"
|
|
|
|
id="email_address"
|
|
|
|
autocomplete="off"
|
|
|
|
:placeholder="[[$t('e_mail_adress')]]"
|
|
|
|
type="email"
|
|
|
|
:class="{ 'border-red-500': (!isEmail(user_email)), 'border-green-300': (isEmail(user_email)) }"
|
|
|
|
class="dark:bg-gray-800 mt-1 block w-full shadow-sm sm:text-sm border-2 bg-gray-50 text-gray-500 rounded-md p-2"
|
|
|
|
/>
|
|
|
|
<p
|
|
|
|
v-if="!isEmail(user_email)"
|
|
|
|
class="text-sm"
|
|
|
|
>{{ $t('please_provide_valid_mail') }}</p>
|
|
|
|
</div>
|
|
|
|
<div class="mt-2">
|
|
|
|
<a
|
|
|
|
:disabled="(!state.submit_enabled)"
|
|
|
|
:class="{ 'opacity-50': (!state.submit_enabled), 'cursor-not-allowed': (!state.submit_enabled) }"
|
|
|
|
@click="resendMail"
|
|
|
|
class="block w-full text-center py-2 px-3 border-2 border-gray-300 rounded-md p-1 dark:bg-gray-800 font-medium hover:border-gray-400 focus:outline-none focus:border-gray-400 sm:text-sm"
|
|
|
|
>{{ $t('resend_the_registration_mail') }}</a>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="mt-12">
|
|
|
|
<div class="relative">
|
|
|
|
<div class="absolute inset-0 flex items-center">
|
|
|
|
<div class="w-full border-t border-gray-300"></div>
|
|
|
|
</div>
|
|
|
|
<div class="relative flex justify-center text-sm">
|
|
|
|
<span class="px-2 bg-white dark:bg-gray-900">{{ $t('not_registered_yet') }}</span>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="mt-2">
|
|
|
|
<a
|
2023-01-30 17:13:50 +00:00
|
|
|
href="/selfservice/register/"
|
2021-04-21 10:33:16 +00:00
|
|
|
class="text-white block w-full text-center py-2 px-3 border-2 border-gray-300 rounded-md p-1 bg-blue-800 font-medium hover:border-gray-400 focus:outline-none focus:border-gray-400 sm:text-sm"
|
|
|
|
>{{ $t('register_now_small') }}</a>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script setup>
|
|
|
|
import { computed, ref, reactive, defineProps } from "vue";
|
|
|
|
import axios from "redaxios";
|
|
|
|
import isEmail from 'validator/es/lib/isEmail';
|
|
|
|
import isMobilePhone from 'validator/es/lib/isMobilePhone';
|
|
|
|
import isPostalCode from 'validator/es/lib/isPostalCode';
|
|
|
|
import { useToast } from "vue-toastification";
|
|
|
|
|
|
|
|
let user_email = ref("");
|
|
|
|
//
|
|
|
|
const state = reactive({
|
|
|
|
org_name: "",
|
|
|
|
org_teams: [],
|
|
|
|
submit_enabled: computed(() => isEmail(user_email.value))
|
|
|
|
})
|
|
|
|
const toast = useToast();
|
|
|
|
function resendMail() {
|
|
|
|
if (isEmail(user_email.value)) {
|
2023-01-31 12:45:28 +00:00
|
|
|
toast("Login-Link wird angefordert...");
|
2021-04-21 10:33:16 +00:00
|
|
|
const browserlocale = ((navigator.languages && navigator.languages[0]) || '').substr(0, 2);
|
|
|
|
axios.post(`${config.baseurl}api/runners/forgot?mail=${user_email.value}&locale=${browserlocale}`)
|
|
|
|
.then(({ data }) => {
|
|
|
|
console.log(data);
|
2023-01-31 12:45:28 +00:00
|
|
|
toast("Login-Link gesendet an " + user_email.value + "!");
|
2021-04-21 10:33:16 +00:00
|
|
|
})
|
|
|
|
.catch((error) => {
|
|
|
|
console.log(error);
|
2023-01-31 12:45:28 +00:00
|
|
|
toast("Fehler beim Anfordern des Login-Links...");
|
2021-04-21 10:33:16 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
2021-04-01 17:07:04 +00:00
|
|
|
</script>
|