basic ForgotPassword improvements
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
validation, steps towards error handlind
This commit is contained in:
parent
b107f5de95
commit
e8c98a0a29
@ -1,23 +1,28 @@
|
|||||||
<script>
|
<script>
|
||||||
|
import { ApiError, AuthService } from "@odit/lfk-client-js";
|
||||||
import { _ } from "svelte-i18n";
|
import { _ } from "svelte-i18n";
|
||||||
import store from "../store.js";
|
|
||||||
store.init();
|
|
||||||
//
|
|
||||||
import { OpenAPI, AuthService } from "@odit/lfk-client-js";
|
|
||||||
import isEmail from "validator/es/lib/isEmail";
|
|
||||||
|
|
||||||
//
|
|
||||||
import Toastify from "toastify-js";
|
import Toastify from "toastify-js";
|
||||||
import "toastify-js/src/toastify.css";
|
import "toastify-js/src/toastify.css";
|
||||||
|
import isEmail from "validator/es/lib/isEmail";
|
||||||
|
|
||||||
let reset_mail_sent = false;
|
let reset_mail_sent = false;
|
||||||
let usersEmail = "";
|
let usersEmail = "";
|
||||||
function reset() {
|
function reset() {
|
||||||
if (isEmail(usersEmail)) {
|
if (isEmail(usersEmail)) {
|
||||||
Toastify({
|
AuthService.authControllerGetResetToken({ email: usersEmail })
|
||||||
text: $_("mail-validation-in-progress"),
|
.then((resp) => {
|
||||||
duration: 3500,
|
console.log(resp);
|
||||||
}).showToast();
|
console.log(resp.resetToken);
|
||||||
reset_mail_sent = true;
|
Toastify({
|
||||||
|
text: $_("mail-validation-in-progress"),
|
||||||
|
duration: 3500,
|
||||||
|
}).showToast();
|
||||||
|
reset_mail_sent = true;
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
console.log(err.body.name);
|
||||||
|
console.log(err.body.message);
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
Toastify({
|
Toastify({
|
||||||
text: $_("invalid-mail-reset"),
|
text: $_("invalid-mail-reset"),
|
||||||
@ -30,11 +35,7 @@
|
|||||||
{#if reset_mail_sent}
|
{#if reset_mail_sent}
|
||||||
<div class="min-h-screen flex items-center justify-center bg-gray-100">
|
<div class="min-h-screen flex items-center justify-center bg-gray-100">
|
||||||
<div class="max-w-md w-full py-12 px-6">
|
<div class="max-w-md w-full py-12 px-6">
|
||||||
<img
|
<img style="height:10rem;" class="mx-auto" src="/lfk-logo.png" alt="" />
|
||||||
style="height:10rem;"
|
|
||||||
class="mx-auto"
|
|
||||||
src="/lfk-logo.png"
|
|
||||||
alt="" />
|
|
||||||
<p class="mt-6 text-lg text-center font-bold text-gray-900">
|
<p class="mt-6 text-lg text-center font-bold text-gray-900">
|
||||||
{$_('application_name')}
|
{$_('application_name')}
|
||||||
</p>
|
</p>
|
||||||
@ -57,11 +58,7 @@
|
|||||||
{:else}
|
{:else}
|
||||||
<div class="min-h-screen flex items-center justify-center bg-gray-100">
|
<div class="min-h-screen flex items-center justify-center bg-gray-100">
|
||||||
<div class="max-w-md w-full py-12 px-6">
|
<div class="max-w-md w-full py-12 px-6">
|
||||||
<img
|
<img style="height:10rem;" class="mx-auto" src="/lfk-logo.png" alt="" />
|
||||||
style="height:10rem;"
|
|
||||||
class="mx-auto"
|
|
||||||
src="/lfk-logo.png"
|
|
||||||
alt="" />
|
|
||||||
<p class="mt-6 text-lg text-center font-bold text-gray-900">
|
<p class="mt-6 text-lg text-center font-bold text-gray-900">
|
||||||
{$_('application_name')}
|
{$_('application_name')}
|
||||||
</p>
|
</p>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user