From 5e46dc387d195c425ea7416bca350349f96b4945 Mon Sep 17 00:00:00 2001 From: openhands Date: Wed, 22 Jul 2026 18:14:50 +0200 Subject: [PATCH] Redirect logged-in users from / to /me --- src/app/(site)/page.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/app/(site)/page.tsx b/src/app/(site)/page.tsx index 85608daa..f9de0534 100644 --- a/src/app/(site)/page.tsx +++ b/src/app/(site)/page.tsx @@ -1,11 +1,13 @@ import Image from "next/image"; import Link from "next/link"; +import { redirect } from "next/navigation"; import { getTranslations } from "next-intl/server"; import { cached } from "@/lib/cache"; import { avatarImageUrl } from "@/lib/format"; import { formatDate } from "@/lib/format-date"; import { prisma } from "@/lib/prisma"; import { siteSettings } from "@/lib/services/site-settings"; +import { auth } from "@/lib/auth"; export const revalidate = 120; @@ -54,6 +56,9 @@ async function getHotelData() { } export default async function Home() { + const session = await auth(); + if (session?.user?.id) redirect("/me"); + const tp = await getTranslations("pages.home"); const th = await getTranslations("header"); const {