From a8219611cbebbd27501d9f30c804979048b98107 Mon Sep 17 00:00:00 2001 From: ivarlovlie Date: Tue, 13 Dec 2022 14:48:11 +0100 Subject: feat: A whole slew of things - Use a md5 hash of the session cookie value as key for session validity check - Introduce global state - Introduce a common interface for form logic, and implement it on the sign-in form - Introduce static resolve() on all services instead of new-upping all over. - Implement /portal on the frontend to support giving the frontend a inital context from server or anywhere. - Show a notification when users sign in for the first time after validating their email --- .../src/routes/(main)/(public)/reset-password/+page.svelte | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'code/app/src/routes/(main)/(public)/reset-password/+page.svelte') diff --git a/code/app/src/routes/(main)/(public)/reset-password/+page.svelte b/code/app/src/routes/(main)/(public)/reset-password/+page.svelte index 55859f6..a45ccdd 100644 --- a/code/app/src/routes/(main)/(public)/reset-password/+page.svelte +++ b/code/app/src/routes/(main)/(public)/reset-password/+page.svelte @@ -12,7 +12,7 @@ }; const formError = new FormError(); - const resetRequests = new PasswordResetService(); + const passwordResetService = PasswordResetService.resolve(); let loading = false; let showSuccessAlert = false; @@ -23,7 +23,7 @@ showSuccessAlert = false; showErrorAlert = false; loading = true; - const response = await resetRequests.create_request_async(formData.email.value); + const response = await passwordResetService.create_request_async(formData.email.value); loading = false; if (response.isCreated) { showSuccessAlert = true; @@ -37,17 +37,12 @@ } } } else { - formError.title = $LL.unexpectedError(); - formError.subtitle = $LL.tryAgainSoon(); + formError.set($LL.unexpectedError(), $LL.tryAgainSoon()); } showErrorAlert = formError.has_error() && !showSuccessAlert; } - - Reset password - Greatoffice - -

-- cgit v1.3