PwReset view
This commit is contained in:
parent
0ff0a29dfe
commit
98bc810e51
@ -10,7 +10,8 @@
|
||||
"@odit/lfk-client-js": "^0.0.4",
|
||||
"svelte-i18n": "^3.3.0",
|
||||
"svelte-spa-router": "^3.1.0",
|
||||
"toastify-js": "^1.9.3"
|
||||
"toastify-js": "^1.9.3",
|
||||
"validator": "^13.5.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"svelte": "^3.29.7",
|
||||
|
@ -36,6 +36,7 @@
|
||||
"/forgot_password": ForgotPassword,
|
||||
"/dashboard": wrap({ component: Dashboard, conditions: [checkAuth] }),
|
||||
"/": wrap({ component: Dashboard, conditions: [checkAuth] }),
|
||||
// "/password_reset_sent/*": Book,
|
||||
|
||||
// Using named parameters, with last being optional
|
||||
// "/author/:first/:last?": Author,
|
||||
|
@ -5,89 +5,128 @@
|
||||
import { push, pop, replace } from "svelte-spa-router";
|
||||
//
|
||||
import { OpenAPI, AuthService } from "@odit/lfk-client-js";
|
||||
OpenAPI.BASE = "http://localhost:4010";
|
||||
import isEmail from "validator/es/lib/isEmail";
|
||||
|
||||
//
|
||||
import Toastify from "toastify-js";
|
||||
import "toastify-js/src/toastify.css";
|
||||
let usersUsername = "";
|
||||
let reset_mail_sent = false;
|
||||
let usersEmail = "";
|
||||
function reset() {
|
||||
Toastify({
|
||||
text: "mail validation in progress...",
|
||||
duration: 3500,
|
||||
}).showToast();
|
||||
if (isEmail(usersEmail)) {
|
||||
Toastify({
|
||||
text: $_("mail-validation-in-progress"),
|
||||
duration: 3500,
|
||||
}).showToast();
|
||||
reset_mail_sent = true;
|
||||
} else {
|
||||
Toastify({
|
||||
text: $_('invalid-mail-reset'),
|
||||
duration: 3500,
|
||||
}).showToast();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="min-h-screen flex items-center justify-center bg-gray-100">
|
||||
<div class="max-w-md w-full py-12 px-6">
|
||||
<img
|
||||
style="height:10rem;"
|
||||
class="mx-auto"
|
||||
src="https://lauf-fuer-kaya.de/Bilder/kaya-logo-quadrat.png"
|
||||
alt="" />
|
||||
<p class="mt-6 text-lg text-center font-bold text-gray-900">
|
||||
{$_('application_name')}
|
||||
</p>
|
||||
<p class="mt-6 text-sm text-center text-gray-900">
|
||||
{$_('forgot_password?')}
|
||||
</p>
|
||||
<p class="mt-2 mb-2 text-sm text-center text-gray-900">
|
||||
{$_('dont-panic-were-resetting-it')}
|
||||
</p>
|
||||
<div>
|
||||
<div class="rounded-md shadow-sm">
|
||||
<div>
|
||||
<input
|
||||
aria-label={$_('email_address_or_username')}
|
||||
name="email"
|
||||
type="email"
|
||||
required=""
|
||||
class="border-gray-300 placeholder-gray-500 appearance-none rounded-none relative block w-full px-3 py-2 border text-gray-900 rounded-t-md focus:outline-none focus:shadow-outline-blue focus:border-blue-300 focus:z-10 sm:text-sm"
|
||||
placeholder={$_('email_address_or_username')}
|
||||
bind:value={usersUsername} />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mt-5">
|
||||
<button
|
||||
on:click={reset}
|
||||
type="submit"
|
||||
class="relative block w-full py-2 px-3 border border-transparent rounded-md text-white font-semibold bg-gray-800 hover:bg-gray-700 focus:bg-gray-900 focus:outline-none focus:shadow-outline sm:text-sm">
|
||||
<span class="absolute left-0 inset-y pl-3">
|
||||
<svg
|
||||
class="h-5 w-5 text-gray-500"
|
||||
fill="currentColor"
|
||||
viewBox="0 0 20 20">
|
||||
<path
|
||||
fill-rule="evenodd"
|
||||
d="M5 9V7a5 5 0 0110 0v2a2 2 0 012 2v5a2 2 0 01-2 2H5a2 2 0 01-2-2v-5a2 2 0 012-2zm8-2v2H7V7a3 3 0 016 0z"
|
||||
clip-rule="evenodd" />
|
||||
</svg>
|
||||
</span>
|
||||
{$_('reset-my-password')}
|
||||
</button>
|
||||
</div>
|
||||
{#if reset_mail_sent}
|
||||
<div class="min-h-screen flex items-center justify-center bg-gray-100">
|
||||
<div class="max-w-md w-full py-12 px-6">
|
||||
<img
|
||||
style="height:10rem;"
|
||||
class="mx-auto"
|
||||
src="https://lauf-fuer-kaya.de/Bilder/kaya-logo-quadrat.png"
|
||||
alt="" />
|
||||
<p class="mt-6 text-lg text-center font-bold text-gray-900">
|
||||
{$_('application_name')}
|
||||
</p>
|
||||
<p class="mt-2 mb-2 text-sm text-center text-gray-900">
|
||||
Passwort-Reset Mail wurde an
|
||||
{usersEmail}
|
||||
geschickt
|
||||
</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 class="relative flex justify-center text-sm">
|
||||
<span
|
||||
class="px-2 bg-gray-100 text-gray-500">{$_('dont-have-your-email-connected')}</span>
|
||||
</div>
|
||||
</div>
|
||||
<span
|
||||
class="mt-2 text-sm px-2 bg-gray-100 text-gray-500 justify-center relative flex">{$_('cannot-reset-your-password-directly')}</span>
|
||||
|
||||
<div class="mt-6">
|
||||
<a
|
||||
href="mailto:lfk@odit.services"
|
||||
href="/#/"
|
||||
class="block w-full text-center py-2 px-3 border border-gray-300 rounded-md text-gray-900 font-medium hover:border-gray-400 focus:outline-none focus:border-gray-400 sm:text-sm">
|
||||
{$_('send-a-mail-to-lfk-odit-services')}
|
||||
{$_('goback')}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{:else}
|
||||
<div class="min-h-screen flex items-center justify-center bg-gray-100">
|
||||
<div class="max-w-md w-full py-12 px-6">
|
||||
<img
|
||||
style="height:10rem;"
|
||||
class="mx-auto"
|
||||
src="https://lauf-fuer-kaya.de/Bilder/kaya-logo-quadrat.png"
|
||||
alt="" />
|
||||
<p class="mt-6 text-lg text-center font-bold text-gray-900">
|
||||
{$_('application_name')}
|
||||
</p>
|
||||
<p class="mt-6 text-sm text-center text-gray-900">
|
||||
{$_('forgot_password?')}
|
||||
</p>
|
||||
<p class="mt-2 mb-2 text-sm text-center text-gray-900">
|
||||
{$_('dont-panic-were-resetting-it')}
|
||||
</p>
|
||||
<div>
|
||||
<div class="rounded-md shadow-sm">
|
||||
<div>
|
||||
<input
|
||||
aria-label={$_('e-mail-adress')}
|
||||
name="email"
|
||||
type="email"
|
||||
required=""
|
||||
class="border-gray-300 placeholder-gray-500 appearance-none rounded-none relative block w-full px-3 py-2 border text-gray-900 rounded-t-md focus:outline-none focus:shadow-outline-blue focus:border-blue-300 focus:z-10 sm:text-sm"
|
||||
placeholder={$_('e-mail-adress')}
|
||||
bind:value={usersEmail} />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mt-5">
|
||||
<button
|
||||
on:click={reset}
|
||||
type="submit"
|
||||
class="relative block w-full py-2 px-3 border border-transparent rounded-md text-white font-semibold bg-gray-800 hover:bg-gray-700 focus:bg-gray-900 focus:outline-none focus:shadow-outline sm:text-sm">
|
||||
<span class="absolute left-0 inset-y pl-3">
|
||||
<svg
|
||||
class="h-5 w-5 text-gray-500"
|
||||
fill="currentColor"
|
||||
viewBox="0 0 20 20">
|
||||
<path
|
||||
fill-rule="evenodd"
|
||||
d="M5 9V7a5 5 0 0110 0v2a2 2 0 012 2v5a2 2 0 01-2 2H5a2 2 0 01-2-2v-5a2 2 0 012-2zm8-2v2H7V7a3 3 0 016 0z"
|
||||
clip-rule="evenodd" />
|
||||
</svg>
|
||||
</span>
|
||||
{$_('reset-my-password')}
|
||||
</button>
|
||||
</div>
|
||||
<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 class="relative flex justify-center text-sm">
|
||||
<span
|
||||
class="px-2 bg-gray-100 text-gray-500">{$_('dont-have-your-email-connected')}</span>
|
||||
</div>
|
||||
</div>
|
||||
<span
|
||||
class="mt-2 text-sm px-2 bg-gray-100 text-gray-500 justify-center relative flex">{$_('cannot-reset-your-password-directly')}</span>
|
||||
|
||||
<div class="mt-6">
|
||||
<a
|
||||
href="mailto:lfk@odit.services"
|
||||
class="block w-full text-center py-2 px-3 border border-gray-300 rounded-md text-gray-900 font-medium hover:border-gray-400 focus:outline-none focus:border-gray-400 sm:text-sm">
|
||||
{$_('send-a-mail-to-lfk-odit-services')}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
|
@ -19,6 +19,7 @@
|
||||
<hr />
|
||||
<ul>
|
||||
{#each tracks as item}
|
||||
<li>{item.name}</li>
|
||||
<li>{item.distance}</li>
|
||||
{/each}
|
||||
</ul>
|
||||
|
@ -18,5 +18,8 @@
|
||||
"register": "Registrieren",
|
||||
"send-a-mail-to-lfk-odit-services": "Sende eine Mail an lfk@odit.services",
|
||||
"dont-panic-were-resetting-it": "Keine Panik, wir setzen es zurück ✌",
|
||||
"dont-have-your-email-connected": "Deine E-Mail ist nicht verknüpft?"
|
||||
"dont-have-your-email-connected": "Deine E-Mail ist nicht verknüpft?",
|
||||
"reset-my-password": "Passwort zurücksetzen",
|
||||
"e-mail-adress": "E-Mail-Adresse",
|
||||
"invalid-mail-reset": "Das ist keine gültige E-Mail"
|
||||
}
|
||||
|
@ -21,5 +21,8 @@
|
||||
"cannot-reset-your-password-directly": "Bummer. We unfortunately cannot reset your password directly. Please send us a mail and confirm your identity",
|
||||
"send-a-mail-to-lfk-odit-services": "send a mail to lfk@odit.services",
|
||||
"dont-have-your-email-connected": "Don't have your email connected?",
|
||||
"dont-panic-were-resetting-it": "Don't panic, we're resetting it ✌"
|
||||
"dont-panic-were-resetting-it": "Don't panic, we're resetting it ✌",
|
||||
"e-mail-adress": "E-Mail Adress",
|
||||
"mail-validation-in-progress": "mail validation in progress...",
|
||||
"invalid-mail-reset": "the provided email is invalid"
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user