Initial working state: CL3.5 complete (Plesk sync + suspend/unsuspend)
This commit is contained in:
26
components/auth/sign-out-button.tsx
Normal file
26
components/auth/sign-out-button.tsx
Normal file
@@ -0,0 +1,26 @@
|
||||
"use client";
|
||||
|
||||
import { useRouter } from "next/navigation";
|
||||
|
||||
import { createSupabaseBrowserClient } from "@/lib/supabase/browser";
|
||||
|
||||
export function SignOutButton() {
|
||||
const router = useRouter();
|
||||
|
||||
async function onSignOut() {
|
||||
const supabase = createSupabaseBrowserClient();
|
||||
await supabase.auth.signOut();
|
||||
router.push("/login");
|
||||
router.refresh();
|
||||
}
|
||||
|
||||
return (
|
||||
<button
|
||||
type="button"
|
||||
onClick={onSignOut}
|
||||
className="rounded-lg border border-slate-300 px-3 py-1.5 text-sm text-slate-700"
|
||||
>
|
||||
Sign out
|
||||
</button>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user