From 401a28944fc0408811aedadd1c3104e2e2d4d7fe Mon Sep 17 00:00:00 2001
From: nsfisis <nsfisis@gmail.com>
Date: Tue, 6 Aug 2024 22:54:21 +0900
Subject: feat(frontend): redirect / to /dashboard if user is logged in

---
 frontend/app/routes/_index.tsx | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

(limited to 'frontend/app/routes/_index.tsx')

diff --git a/frontend/app/routes/_index.tsx b/frontend/app/routes/_index.tsx
index b82efc4..2fcf1f2 100644
--- a/frontend/app/routes/_index.tsx
+++ b/frontend/app/routes/_index.tsx
@@ -1,10 +1,16 @@
-import type { MetaFunction } from "@remix-run/node";
+import type { LoaderFunctionArgs, MetaFunction } from "@remix-run/node";
 import { Link } from "@remix-run/react";
+import { ensureUserNotLoggedIn } from "../.server/auth";
 
 export const meta: MetaFunction = () => [
 	{ title: "iOSDC Japan 2024 Albatross.swift" },
 ];
 
+export async function loader({ request }: LoaderFunctionArgs) {
+	await ensureUserNotLoggedIn(request);
+	return null;
+}
+
 export default function Index() {
 	return (
 		<div className="min-h-screen bg-gray-100 flex items-center justify-center">
-- 
cgit v1.2.3-70-g09d2

