diff options
Diffstat (limited to 'code/app/src/routes/(main)/(public)/portal')
| -rw-r--r-- | code/app/src/routes/(main)/(public)/portal/+page.svelte | 26 | ||||
| -rw-r--r-- | code/app/src/routes/(main)/(public)/portal/+page.ts | 10 |
2 files changed, 36 insertions, 0 deletions
diff --git a/code/app/src/routes/(main)/(public)/portal/+page.svelte b/code/app/src/routes/(main)/(public)/portal/+page.svelte new file mode 100644 index 0000000..bd6aa15 --- /dev/null +++ b/code/app/src/routes/(main)/(public)/portal/+page.svelte @@ -0,0 +1,26 @@ +<script lang="ts"> + import { onMount } from "svelte"; + import type { PageData } from "./$types"; + import type { PortalMessage } from "$configuration"; + import { goto } from "$app/navigation"; + import { sgs } from "$help/global-state"; + + export let data: PageData; + + onMount(async () => { + switch (data.message as PortalMessage) { + case "emailValidated": { + sgs("showEmailValidatedAlertWhenLoggedIn", true); + await goto("/home"); + break; + } + default: { + await goto("/home"); + } + } + }); +</script> + +<div class="p-3"> + <h1>Warping...</h1> +</div> diff --git a/code/app/src/routes/(main)/(public)/portal/+page.ts b/code/app/src/routes/(main)/(public)/portal/+page.ts new file mode 100644 index 0000000..49bf3db --- /dev/null +++ b/code/app/src/routes/(main)/(public)/portal/+page.ts @@ -0,0 +1,10 @@ +import type { PortalMessage } from '$configuration'; +import { redirect } from '@sveltejs/kit'; +import type { PageLoad } from './$types'; + +export const load: PageLoad = async ({ url }) => { + const queryParams = new URLSearchParams(url.search); + const message = queryParams.get("msg") as PortalMessage; + if (!message) throw redirect(302, "/"); + return { message }; +};
\ No newline at end of file |
