fixed basic nav for login/register

This commit is contained in:
masongga
2026-05-23 21:23:39 -06:00
parent 4f45a96c06
commit 4b45ddd182
3 changed files with 65 additions and 3 deletions

View File

@@ -1,16 +1,19 @@
"use client";
import { createClient } from "@/lib/supabase/client";
import { Button } from "@/components/ui/button";
import { useRouter } from "next/navigation";
import { Button } from "@/components/ui/button";
import { createClient } from "@/lib/supabase/client";
import { routes } from "@/lib/routes";
export function LogoutButton() {
const router = useRouter();
const logout = async () => {
const supabase = createClient();
await supabase.auth.signOut();
router.push("/auth/login");
router.push(routes.home);
router.refresh();
};
return <Button onClick={logout}>Logout</Button>;