From 900bb5e845c3ad44defbd427cae3d44a4a43321f Mon Sep 17 00:00:00 2001 From: ivarlovlie Date: Sat, 25 Feb 2023 13:15:44 +0100 Subject: feat: Initial commit --- .../(main)/(public)/reset-password/+page.svelte | 81 +++++++++++++++++++++ .../routes/(main)/(public)/reset-password/+page.ts | 11 +++ .../(public)/reset-password/[id]/+page.server.ts | 11 +++ .../(public)/reset-password/[id]/+page.svelte | 82 ++++++++++++++++++++++ .../(main)/(public)/reset-password/[id]/+page.ts | 11 +++ 5 files changed, 196 insertions(+) create mode 100644 code/app/src/routes/(main)/(public)/reset-password/+page.svelte create mode 100644 code/app/src/routes/(main)/(public)/reset-password/+page.ts create mode 100644 code/app/src/routes/(main)/(public)/reset-password/[id]/+page.server.ts create mode 100644 code/app/src/routes/(main)/(public)/reset-password/[id]/+page.svelte create mode 100644 code/app/src/routes/(main)/(public)/reset-password/[id]/+page.ts (limited to 'code/app/src/routes/(main)/(public)/reset-password') diff --git a/code/app/src/routes/(main)/(public)/reset-password/+page.svelte b/code/app/src/routes/(main)/(public)/reset-password/+page.svelte new file mode 100644 index 0000000..a45ccdd --- /dev/null +++ b/code/app/src/routes/(main)/(public)/reset-password/+page.svelte @@ -0,0 +1,81 @@ + + +
+
+

+ {$LL.resetPasswordPage.requestAPasswordReset()} +

+

+ {$LL.or().toLowerCase()} + + {$LL.signIntoYourAccount().toLowerCase()} + +

+
+ +
+
+
+ {#if showErrorAlert} + + {:else if showSuccessAlert} + + {/if} + +
+
+
diff --git a/code/app/src/routes/(main)/(public)/reset-password/+page.ts b/code/app/src/routes/(main)/(public)/reset-password/+page.ts new file mode 100644 index 0000000..c0859e0 --- /dev/null +++ b/code/app/src/routes/(main)/(public)/reset-password/+page.ts @@ -0,0 +1,11 @@ +import LL from '$i18n/i18n-svelte'; +import { get } from 'svelte/store'; +import type { PageLoad } from './$types'; + +const l = get(LL); + +export const load: PageLoad = async () => { + return { + title: l.resetPasswordPage.title(), + }; +}; \ No newline at end of file diff --git a/code/app/src/routes/(main)/(public)/reset-password/[id]/+page.server.ts b/code/app/src/routes/(main)/(public)/reset-password/[id]/+page.server.ts new file mode 100644 index 0000000..22fa29d --- /dev/null +++ b/code/app/src/routes/(main)/(public)/reset-password/[id]/+page.server.ts @@ -0,0 +1,11 @@ +import { is_guid } from "$utilities/validators"; +import { redirect } from "@sveltejs/kit"; +import type { PageServerLoad } from "./$types"; + +export const load: PageServerLoad = async ({ params }) => { + const resetRequestId = params.id ?? ""; + if (!is_guid(resetRequestId)) throw redirect(302, "/reset-password"); + return { + resetRequestId, + }; +}; \ No newline at end of file diff --git a/code/app/src/routes/(main)/(public)/reset-password/[id]/+page.svelte b/code/app/src/routes/(main)/(public)/reset-password/[id]/+page.svelte new file mode 100644 index 0000000..27a1af5 --- /dev/null +++ b/code/app/src/routes/(main)/(public)/reset-password/[id]/+page.svelte @@ -0,0 +1,82 @@ + + +
+ {#if finishedPreliminaryLoading} +
+

+ {$LL.resetPasswordPage.setANewPassword()} +

+

+ {$LL.or().toLowerCase()} + + {$LL.signIntoYourAccount().toLowerCase()} + +

+
+ +
+
+
+ {#if requestIsInvalid} + + {/if} + +
+
+ {:else} +

Checking your request...

+ {/if} +
diff --git a/code/app/src/routes/(main)/(public)/reset-password/[id]/+page.ts b/code/app/src/routes/(main)/(public)/reset-password/[id]/+page.ts new file mode 100644 index 0000000..3252b7a --- /dev/null +++ b/code/app/src/routes/(main)/(public)/reset-password/[id]/+page.ts @@ -0,0 +1,11 @@ +import LL from '$i18n/i18n-svelte'; +import { get } from 'svelte/store'; +import type { PageLoad } from './$types'; + +const l = get(LL); + +export const load: PageLoad = async () => { + return { + title: l.resetPasswordPage.fulfillTitle(), + }; +}; \ No newline at end of file -- cgit v1.3