🐸 Rybbit - open-source and privacy-friendly alternative to Google Analytics that is 10x more intuitive.
import { useQueryClient } from "@tanstack/react-query";
import { useRouter } from "next/navigation";
import { authClient } from "../lib/auth";
export function useSignout() {
const queryClient = useQueryClient();
const router = useRouter();
return async () => {
queryClient.clear();
await authClient.signOut();
router.push("/login");
};
}