feat: replace login route with auth modal

- Add AuthModal to root layout driven by ?modal=auth search param
- Update multiplayer and play beforeLoad redirects to use modal
- Update NavAuth and Hero links to use modal
- Delete login route and NavLogin component
This commit is contained in:
lila 2026-04-30 19:46:45 +02:00
parent 32ee1edf80
commit dc11213cb5
8 changed files with 41 additions and 79 deletions

View file

@ -14,7 +14,10 @@ export const Route = createFileRoute("/multiplayer")({
beforeLoad: async () => {
const { data: session } = await authClient.getSession();
if (!session) {
throw redirect({ to: "/login" });
throw redirect({
to: "/",
search: { modal: "auth", redirect: "/multiplayer" },
});
}
return { session };
},