From 6a83355db1285048bf875296ca611b2619b48783 Mon Sep 17 00:00:00 2001 From: laraproto Date: Sat, 2 Nov 2024 22:26:39 +0200 Subject: [PATCH] hm --- revampdashboard/src/routes/+page.svelte | 7 ++++++- revampdashboard/src/routes/+page.ts | 17 +++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 revampdashboard/src/routes/+page.ts diff --git a/revampdashboard/src/routes/+page.svelte b/revampdashboard/src/routes/+page.svelte index 0386c4ba..ad353d60 100644 --- a/revampdashboard/src/routes/+page.svelte +++ b/revampdashboard/src/routes/+page.svelte @@ -1,9 +1,14 @@
-
+
+ {data.error} +
diff --git a/revampdashboard/src/routes/+page.ts b/revampdashboard/src/routes/+page.ts new file mode 100644 index 00000000..43a745cb --- /dev/null +++ b/revampdashboard/src/routes/+page.ts @@ -0,0 +1,17 @@ +import type { PageLoad } from './$types'; + +const errorMessages = { + noAccess: + 'No dashboard access. If you think this is a mistake, please contact your server owner.', + expiredLogin: 'Dashboard login expired. Please log in again.' +}; + +export const load: PageLoad = ({ url }) => { + const error = String(url.searchParams.get('error') ?? ''); + + if (error) { + return { + error: errorMessages[error as keyof typeof errorMessages] || 'Unexpected error' + }; + } +};