diff --git a/src/hooks.server.ts b/src/hooks.server.ts index 41b82816713cfb9dae19aac16723b826854e2512..e78272b19e4626d44948bfdff427458515d072ee 100644 --- a/src/hooks.server.ts +++ b/src/hooks.server.ts @@ -1,12 +1,12 @@ -// import { sequence } from "@sveltejs/kit/hooks"; -// import { type Handle, redirect } from "@sveltejs/kit"; -// import { aidc } from "$lib/auth"; +import { sequence } from "@sveltejs/kit/hooks"; +import { type Handle, redirect } from "@sveltejs/kit"; +import { aidc } from "$lib/auth"; -// const authGuard: Handle = async ({ event, resolve }) => { -// if (!event.locals.user) { -// redirect(303, event.locals.authPaths.login); -// } -// return resolve(event); -// }; +const authGuard: Handle = async ({ event, resolve }) => { + if (!event.locals.user) { + redirect(303, event.locals.authPaths.login); + } + return resolve(event); +}; -// export const handle = sequence(aidc.handler(), authGuard); +export const handle = sequence(aidc.handler(), authGuard); diff --git a/src/routes/quiz/+page.svelte b/src/routes/quiz/+page.svelte index 3e7d98004a73fc90380bc73a8d1b42d1be34c50d..17e8fcb70cedf4fd9c61bf84377735973a3c56e0 100644 --- a/src/routes/quiz/+page.svelte +++ b/src/routes/quiz/+page.svelte @@ -57,11 +57,13 @@ class="relative z-10 flex h-64 w-64 items-center justify-center overflow-hidden rounded-2xl border-6 border-solid border-zinc-800 bg-white before:absolute before:-z-10 before:h-32 before:w-32 before:rounded-full before:bg-slate-300 before:opacity-100 before:transition-[0.65s] before:duration-[ease-in-out] after:absolute after:-z-10 after:h-32 after:w-32 after:scale-0 after:rounded-full after:border-solid after:border-slate-300 after:transition-[0.4s] after:duration-[ease-in-out]" > <img src={thumbnail} alt="" class="absolute w-full" /> - <img - src={data.photo?.url} - alt="Chargement..." - class="absolute w-auto" - /> + {#key data.photo} + <img + src={data.photo?.url} + alt="Chargement..." + class="absolute w-auto" + /> + {/key} </div> <span class="absolute left-0 top-0 z-20 rounded-br-xl rounded-tl-2xl bg-zinc-800 px-2 text-xl text-white"