CDP Frontend SDK
    Preparing search index...
    • Hook that provides a wrapped sign-out function with authentication checks. This hook uses useEnforceAuthenticated to ensure the user is signed in before attempting to sign out.

      Returns { signOut: () => Promise<void> }

      function SignOutButton() {
      const { signOut } = useSignOut();
      const navigate = useNavigate();

      const handleSignOut = async () => {
      try {
      await signOut();
      navigate("/sign-in");
      } catch (error) {
      console.error("Failed to sign out:", error);
      }
      };

      return (
      <button onClick={handleSignOut}>
      Sign Out
      </button>
      );
      }