From b60f71b219412da45e8e910189e374a6ea03c478 Mon Sep 17 00:00:00 2001
From: ivarlovlie <git@ivarlovlie.no>
Date: Wed, 28 Sep 2022 21:50:42 +0800
Subject: fix: Align public route checking with new layout groups

---
 apps/kit/src/routes/(main)/+layout.svelte | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

(limited to 'apps/kit/src/routes/(main)/+layout.svelte')

diff --git a/apps/kit/src/routes/(main)/+layout.svelte b/apps/kit/src/routes/(main)/+layout.svelte
index e5b177e..b2b4818 100644
--- a/apps/kit/src/routes/(main)/+layout.svelte
+++ b/apps/kit/src/routes/(main)/+layout.svelte
@@ -14,9 +14,7 @@
     async function redirect_if_necessary(ticket: Navigation) {
         const sessionIsValid = await is_active();
         // TODO: ticket.to can be empty while navigating, so coalesce could probably cause non-public routes to cause a redir to /login...
-        const isPublicRoute =
-            (ticket.to?.routeId?.startsWith("(public)") ?? true) ||
-            ticket.to?.routeId?.startsWith("book");
+        const isPublicRoute = ticket.to?.routeId?.startsWith("(main)/(public)");
 
         console.log("redir: ", {
             isPublicRoute,
-- 
cgit v1.3

