Redirect logged-in users from / to /me
This commit is contained in:
1 parent
2438f4f7a8
commit
5e46dc387d
1 file changed
+5
@@ -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 {
|
||||
|
||||
Reference in new issue
Block a user