From 72cc46009e891f3104602fd3b73e6ac23576f55d Mon Sep 17 00:00:00 2001 From: ivarlovlie Date: Thu, 29 Sep 2022 22:47:30 +0800 Subject: feat: !WIP Implement password reset request fulfillment --- .../(public)/reset-password/[id]/+page.server.ts | 11 ++ .../(public)/reset-password/[id]/+page.svelte | 121 +++++++++++++++++++++ 2 files changed, 132 insertions(+) create mode 100644 apps/kit/src/routes/(main)/(public)/reset-password/[id]/+page.server.ts create mode 100644 apps/kit/src/routes/(main)/(public)/reset-password/[id]/+page.svelte (limited to 'apps/kit/src/routes/(main)/(public)') diff --git a/apps/kit/src/routes/(main)/(public)/reset-password/[id]/+page.server.ts b/apps/kit/src/routes/(main)/(public)/reset-password/[id]/+page.server.ts new file mode 100644 index 0000000..389d04c --- /dev/null +++ b/apps/kit/src/routes/(main)/(public)/reset-password/[id]/+page.server.ts @@ -0,0 +1,11 @@ +import { is_guid } from '$lib/helpers'; +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/apps/kit/src/routes/(main)/(public)/reset-password/[id]/+page.svelte b/apps/kit/src/routes/(main)/(public)/reset-password/[id]/+page.svelte new file mode 100644 index 0000000..7b46d2d --- /dev/null +++ b/apps/kit/src/routes/(main)/(public)/reset-password/[id]/+page.svelte @@ -0,0 +1,121 @@ + + +
+ {#if finishedPreliminaryLoading} +
+

+ {$LL.requestAPasswordReset()} +

+

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

+
+ +
+
+
+ + + + + +
+
+ {:else} +

Checking your request...

+ {/if} +
-- cgit v1.3