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,19 +5,57 @@
|
||||
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() {
|
||||
if (isEmail(usersEmail)) {
|
||||
Toastify({
|
||||
text: "mail validation in progress...",
|
||||
text: $_("mail-validation-in-progress"),
|
||||
duration: 3500,
|
||||
}).showToast();
|
||||
reset_mail_sent = true;
|
||||
} else {
|
||||
Toastify({
|
||||
text: $_('invalid-mail-reset'),
|
||||
duration: 3500,
|
||||
}).showToast();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
{#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="mt-6">
|
||||
<a
|
||||
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">
|
||||
{$_('goback')}
|
||||
</a>
|
||||
</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
|
||||
@ -38,13 +76,13 @@
|
||||
<div class="rounded-md shadow-sm">
|
||||
<div>
|
||||
<input
|
||||
aria-label={$_('email_address_or_username')}
|
||||
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={$_('email_address_or_username')}
|
||||
bind:value={usersUsername} />
|
||||
placeholder={$_('e-mail-adress')}
|
||||
bind:value={usersEmail} />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -91,3 +129,4 @@
|
||||
</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