UNPKG

universal-auth-sdk

Version:

A Universal Authentication SDK for React supporting OAuth, OpenID, SAML, and Kerberos.

12 lines (11 loc) 374 B
import { jsx as _jsx } from "react/jsx-runtime"; import { useAuth } from "../hooks/useAuth"; const LogoutButton = () => { const auth = useAuth(); if (!auth) { throw new Error("useAuth must be used within an AuthProvider"); } const { logout } = auth; return _jsx("button", { onClick: logout, children: "Logout" }); }; export default LogoutButton;