feat(auth0) add onClick prop to Button tag

This commit is contained in:
dancingCycle 2022-07-18 18:20:15 +02:00
parent ea29090eee
commit 2f495ba51c
2 changed files with 24 additions and 6 deletions

View File

@ -1,9 +1,18 @@
import { useAuth0 } from '@auth0/auth0-react';
import React from 'react';
function LoginButton(props) {
const { loginWithRedirect } = useAuth0()
return (
<div>
<button className="loginButton">Login</button>
<button
onClick={()=>loginWithRedirect()}
className="loginButton"
>
Login
</button>
</div>
);
};
)
}
export default LoginButton;

View File

@ -1,9 +1,18 @@
import { useAuth0 } from '@auth0/auth0-react';
import React from 'react';
function LogoutButton(props) {
const { loginWithRedirect } = useAuth0()
return (
<div>
<button className="loginButton">Logout</button>
<button
onClick={()=>loginWithRedirect()}
className="loginButton"
>
Logout
</button>
</div>
);
};
)
}
export default LogoutButton;