npm install @auth0/auth0-react
import { Auth0Provider } from "@auth0/auth0-react";
const domain = "your-auth0-domain";
const clientId = "your-auth0-client-id";
import { useAuth0 } from "@auth0/auth0-react";
const AuthButtons = () => {
const { loginWithRedirect, logout, isAuthenticated, user } = useAuth0();
return (
{!isAuthenticated ? (
) : (
<>
);
};
export default AuthButtons;
Welcome {user.name}
> )}