Skip to content

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

🐛 Handle missing session (#1456)

Luke Vella2b211217a1a0
diff --git a/apps/web/src/app/[locale]/layout.tsx b/apps/web/src/app/[locale]/layout.tsx
index bae2c6a25..fe7f293be 100644
--- a/apps/web/src/app/[locale]/layout.tsx
+++ b/apps/web/src/app/[locale]/layout.tsx
@@ -4,6 +4,7 @@ import "../../style.css";
import { Toaster } from "@rallly/ui/toaster";
import type { Viewport } from "next";
import { Inter } from "next/font/google";
+import { redirect } from "next/navigation";
import React from "react";
import { TimeZoneChangeDetector } from "@/app/[locale]/timezone-change-detector";
@@ -31,6 +32,11 @@ export default async function Root({
params: { locale: string };
}) {
const session = await getServerSession();
+
+ if (!session) {
+ redirect("/login");
+ }
+
return (
<html lang={locale} className={inter.className}>
<body>