Skip to content

Rallly is an open-source scheduling and collaboration tool designed to make organizing events and meetings easier.

🐛 Fix check for missing token on initial render (#1054)

Luke Vella8a69deee534e
diff --git a/apps/web/src/middleware.ts b/apps/web/src/middleware.ts
index 9072ce163..63adc62c9 100644
--- a/apps/web/src/middleware.ts
+++ b/apps/web/src/middleware.ts
@@ -48,10 +48,10 @@ export const middleware = withAuth(
callbacks: {
authorized: ({ token, req }) => {
const nextUrl = req.nextUrl;
-
+ const isGuest = !token?.email;
if (
isSelfHosted &&
- token?.email === null &&
+ isGuest &&
!(
nextUrl.pathname.startsWith("/invite") ||
nextUrl.pathname.startsWith("/login") ||