mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
This PR updates the `with-supabase` template to better auth pages, Tailwind v4 and newest `components.json` for full compatibility with shadcn/ui. The `(auth-pages)` folder has been removed. For auth, the template is now using the [password based auth block](https://supabase.com/ui/docs/nextjs/password-based-auth) from the Supabase UI Library which makes it easier to update it and keep it up-to-date. --------- Co-authored-by: Lee Robinson <[email protected]>
18 lines
422 B
TypeScript
18 lines
422 B
TypeScript
"use client";
|
|
|
|
import { createClient } from "@/lib/supabase/client";
|
|
import { Button } from "@/components/ui/button";
|
|
import { useRouter } from "next/navigation";
|
|
|
|
export function LogoutButton() {
|
|
const router = useRouter();
|
|
|
|
const logout = async () => {
|
|
const supabase = createClient();
|
|
await supabase.auth.signOut();
|
|
router.push("/auth/login");
|
|
};
|
|
|
|
return <Button onClick={logout}>Logout</Button>;
|
|
}
|