diff options
| author | nsfisis <nsfisis@gmail.com> | 2024-08-01 23:34:59 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2024-08-01 23:34:59 +0900 |
| commit | db06c9332776b41b3fef537f9e6d76d38f0463b3 (patch) | |
| tree | b25c8226efa42be3e631cdf2f047c13c1b807889 /frontend/app/routes/dashboard.tsx | |
| parent | 6b600ca0ca50c9322a95858bd7d4b6813a7ba2d5 (diff) | |
| parent | ca4e86c99a935c41b319efea43365221569c7d62 (diff) | |
| download | phperkaigi-2025-albatross-db06c9332776b41b3fef537f9e6d76d38f0463b3.tar.gz phperkaigi-2025-albatross-db06c9332776b41b3fef537f9e6d76d38f0463b3.tar.zst phperkaigi-2025-albatross-db06c9332776b41b3fef537f9e6d76d38f0463b3.zip | |
Merge branch 'feat/auth'
Diffstat (limited to 'frontend/app/routes/dashboard.tsx')
| -rw-r--r-- | frontend/app/routes/dashboard.tsx | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/frontend/app/routes/dashboard.tsx b/frontend/app/routes/dashboard.tsx index 1c2137d..45381e1 100644 --- a/frontend/app/routes/dashboard.tsx +++ b/frontend/app/routes/dashboard.tsx @@ -2,16 +2,14 @@ import type { LoaderFunctionArgs, MetaFunction } from "@remix-run/node"; import { redirect } from "@remix-run/node"; import { Form, Link, useLoaderData } from "@remix-run/react"; import { apiGetGames } from "../.server/api/client"; -import { isAuthenticated } from "../.server/auth"; +import { ensureUserLoggedIn } from "../.server/auth"; export const meta: MetaFunction = () => { return [{ title: "Dashboard | iOSDC Japan 2024 Albatross.swift" }]; }; export async function loader({ request }: LoaderFunctionArgs) { - const { user, token } = await isAuthenticated(request, { - failureRedirect: "/login", - }); + const { user, token } = await ensureUserLoggedIn(request); if (user.is_admin) { return redirect("/admin/dashboard"); } |
