From cacd727c0ea9a920a2d98431b1ecc47036ca3bbb Mon Sep 17 00:00:00 2001 From: Mawoka Date: Thu, 18 Aug 2022 16:22:44 +0200 Subject: [PATCH] :arrow_up: Finished upgrading SvelteKit --- frontend/src/app.d.ts | 4 -- frontend/src/hooks.ts | 6 +-- frontend/src/routes/+error.svelte | 20 ++------ frontend/src/routes/+layout.server.ts | 13 +++++ frontend/src/routes/+layout.svelte | 15 ------ frontend/src/routes/+layout.ts | 10 ++-- frontend/src/routes/+page.ts | 12 ----- frontend/src/routes/account/+layout.svelte | 15 ------ .../src/routes/account/login/+page.svelte | 7 +-- frontend/src/routes/account/login/+page.ts | 6 ++- .../routes/account/oauth-error/+page.svelte | 7 +-- .../account/password-reset/+page.svelte | 9 ++-- frontend/src/routes/admin/+page.svelte | 23 ++++----- frontend/src/routes/create/+page.svelte | 21 -------- frontend/src/routes/docs/+layout.svelte | 15 ------ frontend/src/routes/edit/+page.svelte | 48 +++---------------- frontend/src/routes/explore/+page.svelte | 15 ------ frontend/src/routes/import/+page.svelte | 25 ---------- frontend/src/routes/play/+page.svelte | 27 +---------- frontend/src/routes/search/+page.svelte | 15 ------ .../src/routes/view/[quiz_id]/+page.svelte | 15 +++--- 21 files changed, 60 insertions(+), 268 deletions(-) create mode 100644 frontend/src/routes/+layout.server.ts delete mode 100644 frontend/src/routes/+page.ts diff --git a/frontend/src/app.d.ts b/frontend/src/app.d.ts index 689ff31..2fc573f 100644 --- a/frontend/src/app.d.ts +++ b/frontend/src/app.d.ts @@ -14,10 +14,6 @@ declare namespace App { } // interface Platform {} - interface Session { - authenticated: boolean; - email: string | null; - } // interface Stuff {} } diff --git a/frontend/src/hooks.ts b/frontend/src/hooks.ts index e7439b2..3962ee0 100644 --- a/frontend/src/hooks.ts +++ b/frontend/src/hooks.ts @@ -5,7 +5,7 @@ */ import * as cookie from 'cookie'; -import type { Handle, GetSession } from '@sveltejs/kit'; +import type { Handle } from '@sveltejs/kit'; /** @type {import('@sveltejs/kit').Handle} */ export const handle: Handle = async ({ event, resolve }) => { @@ -54,9 +54,9 @@ export const handle: Handle = async ({ event, resolve }) => { } }; -export const getSession: GetSession = async (event) => { +/*export const getSession: GetSession = async (event) => { return { email: event.locals.email, authenticated: Boolean(event.locals.email) }; -}; +};*/ diff --git a/frontend/src/routes/+error.svelte b/frontend/src/routes/+error.svelte index 1d9762b..4d7837c 100644 --- a/frontend/src/routes/+error.svelte +++ b/frontend/src/routes/+error.svelte @@ -3,26 +3,12 @@ - License, v. 2.0. If a copy of the MPL was not distributed with this - file, You can obtain one at https://mozilla.org/MPL/2.0/. --> - - - - -
diff --git a/frontend/src/routes/account/password-reset/+page.svelte b/frontend/src/routes/account/password-reset/+page.svelte index 2d1ad69..7ea97e1 100644 --- a/frontend/src/routes/account/password-reset/+page.svelte +++ b/frontend/src/routes/account/password-reset/+page.svelte @@ -4,14 +4,11 @@ - file, You can obtain one at https://mozilla.org/MPL/2.0/. --> - - - - - - -