// Author: Simon-Pierre Boucher
// Contact: contact@spboucher.ai
// Project: chat.spboucher.ai

import { redirect } from "next/navigation";
import { currentSession } from "@/lib/auth/guard";
import { ChatApp } from "@/components/ChatApp";
import { RegisterSw } from "@/components/RegisterSw";

export const dynamic = "force-dynamic";

export default async function HomePage() {
  const session = await currentSession();
  if (!session) redirect("/login");
  return (
    <>
      <ChatApp />
      <RegisterSw />
    </>
  );
}
