diff options
Diffstat (limited to 'src/routes/(static)/+layout.server.ts')
| -rw-r--r-- | src/routes/(static)/+layout.server.ts | 19 |
1 files changed, 2 insertions, 17 deletions
diff --git a/src/routes/(static)/+layout.server.ts b/src/routes/(static)/+layout.server.ts index bd8ce5a8..a6c5a722 100644 --- a/src/routes/(static)/+layout.server.ts +++ b/src/routes/(static)/+layout.server.ts @@ -1,19 +1,4 @@ -import { auth, get, isInvalidTokenError } from "$lib/utils"; -import { redirect } from "@sveltejs/kit"; - -export async function load({ cookies }) { - const token = cookies.get("token"); - - let user; - if (token) { - try { - user = await get("/me", auth(cookies)); - } catch (e) { - if (isInvalidTokenError(e)) { - redirect(307, "/logout"); - } - } - } - +export async function load({ parent }) { + const { user } = await parent(); return { user }; } |
