parent
1102d29c0e
commit
020c310865
@ -1,104 +1,104 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="min-h-screen flex items-center justify-center">
|
<div class="min-h-screen flex items-center justify-center">
|
||||||
<div class="max-w-md w-full py-12 px-6">
|
<div class="max-w-md w-full py-12 px-6">
|
||||||
<img class="mx-auto h-24 w-auto" src="/favicon.png" alt />
|
<img class="mx-auto h-24 w-auto" src="/favicon.png" alt />
|
||||||
<h1
|
<h1
|
||||||
class="sm:text-3xl text-2xl font-medium title-font mb-4 text-center"
|
class="sm:text-3xl text-2xl font-medium title-font mb-4 text-center"
|
||||||
>Lauf für Kaya! - {{ $t('profile') }}</h1>
|
>Lauf für Kaya! - {{ $t('profile') }}</h1>
|
||||||
<p class="mx-auto leading-relaxed text-base text-center">
|
<p class="mx-auto leading-relaxed text-base text-center">
|
||||||
{{ $t('you_have_not_provided_a_valid_access_key') }}
|
{{ $t('you_have_not_provided_a_valid_access_key') }}
|
||||||
<br />
|
<br />
|
||||||
{{ $t('access_is_only_provided_via_your_email_link') }}
|
{{ $t('access_is_only_provided_via_your_email_link') }}
|
||||||
</p>
|
</p>
|
||||||
<div class="mt-6">
|
<div class="mt-6">
|
||||||
<div class="relative">
|
<div class="relative">
|
||||||
<div class="absolute inset-0 flex items-center">
|
<div class="absolute inset-0 flex items-center">
|
||||||
<div class="w-full border-t border-gray-300"></div>
|
<div class="w-full border-t border-gray-300"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="relative flex justify-center text-sm">
|
<div class="relative flex justify-center text-sm">
|
||||||
<span
|
<span
|
||||||
class="px-2 bg-white dark:bg-gray-900"
|
class="px-2 bg-white dark:bg-gray-900"
|
||||||
>{{ $t('lost_your_registration_mail') }}</span>
|
>{{ $t('lost_your_registration_mail') }}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="mt-4">
|
<div class="mt-4">
|
||||||
<label for="email_address" class="block font-medium">
|
<label for="email_address" class="block font-medium">
|
||||||
{{ $t('e_mail_adress') }}
|
{{ $t('e_mail_adress') }}
|
||||||
<span class="font-bold">*</span>
|
<span class="font-bold">*</span>
|
||||||
</label>
|
</label>
|
||||||
<input
|
<input
|
||||||
v-model="user_email"
|
v-model="user_email"
|
||||||
name="email_address"
|
name="email_address"
|
||||||
id="email_address"
|
id="email_address"
|
||||||
autocomplete="off"
|
autocomplete="off"
|
||||||
:placeholder="[[$t('e_mail_adress')]]"
|
:placeholder="[[$t('e_mail_adress')]]"
|
||||||
type="email"
|
type="email"
|
||||||
:class="{ 'border-red-500': (!isEmail(user_email)), 'border-green-300': (isEmail(user_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"
|
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
|
<p
|
||||||
v-if="!isEmail(user_email)"
|
v-if="!isEmail(user_email)"
|
||||||
class="text-sm"
|
class="text-sm"
|
||||||
>{{ $t('please_provide_valid_mail') }}</p>
|
>{{ $t('please_provide_valid_mail') }}</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="mt-2">
|
<div class="mt-2">
|
||||||
<a
|
<a
|
||||||
:disabled="(!state.submit_enabled)"
|
:disabled="(!state.submit_enabled)"
|
||||||
:class="{ 'opacity-50': (!state.submit_enabled), 'cursor-not-allowed': (!state.submit_enabled) }"
|
:class="{ 'opacity-50': (!state.submit_enabled), 'cursor-not-allowed': (!state.submit_enabled) }"
|
||||||
@click="resendMail"
|
@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"
|
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>
|
>{{ $t('resend_the_registration_mail') }}</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="mt-12">
|
<div class="mt-12">
|
||||||
<div class="relative">
|
<div class="relative">
|
||||||
<div class="absolute inset-0 flex items-center">
|
<div class="absolute inset-0 flex items-center">
|
||||||
<div class="w-full border-t border-gray-300"></div>
|
<div class="w-full border-t border-gray-300"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="relative flex justify-center text-sm">
|
<div class="relative flex justify-center text-sm">
|
||||||
<span class="px-2 bg-white dark:bg-gray-900">{{ $t('not_registered_yet') }}</span>
|
<span class="px-2 bg-white dark:bg-gray-900">{{ $t('not_registered_yet') }}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="mt-2">
|
<div class="mt-2">
|
||||||
<a
|
<a
|
||||||
href="./register/"
|
href="../register/"
|
||||||
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"
|
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>
|
>{{ $t('register_now_small') }}</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { computed, ref, reactive, defineProps } from "vue";
|
import { computed, ref, reactive, defineProps } from "vue";
|
||||||
import axios from "redaxios";
|
import axios from "redaxios";
|
||||||
import isEmail from 'validator/es/lib/isEmail';
|
import isEmail from 'validator/es/lib/isEmail';
|
||||||
import isMobilePhone from 'validator/es/lib/isMobilePhone';
|
import isMobilePhone from 'validator/es/lib/isMobilePhone';
|
||||||
import isPostalCode from 'validator/es/lib/isPostalCode';
|
import isPostalCode from 'validator/es/lib/isPostalCode';
|
||||||
import { useToast } from "vue-toastification";
|
import { useToast } from "vue-toastification";
|
||||||
|
|
||||||
let user_email = ref("");
|
let user_email = ref("");
|
||||||
//
|
//
|
||||||
const state = reactive({
|
const state = reactive({
|
||||||
org_name: "",
|
org_name: "",
|
||||||
org_teams: [],
|
org_teams: [],
|
||||||
submit_enabled: computed(() => isEmail(user_email.value))
|
submit_enabled: computed(() => isEmail(user_email.value))
|
||||||
})
|
})
|
||||||
const toast = useToast();
|
const toast = useToast();
|
||||||
function resendMail() {
|
function resendMail() {
|
||||||
if (isEmail(user_email.value)) {
|
if (isEmail(user_email.value)) {
|
||||||
toast("sending password reset mail...");
|
toast("sending password reset mail...");
|
||||||
const browserlocale = ((navigator.languages && navigator.languages[0]) || '').substr(0, 2);
|
const browserlocale = ((navigator.languages && navigator.languages[0]) || '').substr(0, 2);
|
||||||
axios.post(`${config.baseurl}api/runners/forgot?mail=${user_email.value}&locale=${browserlocale}`)
|
axios.post(`${config.baseurl}api/runners/forgot?mail=${user_email.value}&locale=${browserlocale}`)
|
||||||
.then(({ data }) => {
|
.then(({ data }) => {
|
||||||
console.log(data);
|
console.log(data);
|
||||||
toast("sent password reset mail to " + user_email.value + "!");
|
toast("sent password reset mail to " + user_email.value + "!");
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
toast("user does not exist...");
|
toast("user does not exist...");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
Loading…
x
Reference in New Issue
Block a user