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:
parent
32ee1edf80
commit
dc11213cb5
8 changed files with 41 additions and 79 deletions
|
|
@ -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 };
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue