From 2f495ba51c6b09773ea673327bf3c029ad1dcb0e Mon Sep 17 00:00:00 2001 From: "Begerad, Stefan" Date: Mon, 18 Jul 2022 18:20:15 +0200 Subject: [PATCH] feat(auth0) add onClick prop to Button tag --- auth0/app/components/login-button.jsx | 15 ++++++++++++--- auth0/app/components/logout-button.jsx | 15 ++++++++++++--- 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/auth0/app/components/login-button.jsx b/auth0/app/components/login-button.jsx index c52ccb8..daa82e4 100644 --- a/auth0/app/components/login-button.jsx +++ b/auth0/app/components/login-button.jsx @@ -1,9 +1,18 @@ +import { useAuth0 } from '@auth0/auth0-react'; import React from 'react'; + function LoginButton(props) { + const { loginWithRedirect } = useAuth0() return (
- +
- ); -}; + ) +} + export default LoginButton; diff --git a/auth0/app/components/logout-button.jsx b/auth0/app/components/logout-button.jsx index 3359e38..5a0d177 100644 --- a/auth0/app/components/logout-button.jsx +++ b/auth0/app/components/logout-button.jsx @@ -1,9 +1,18 @@ +import { useAuth0 } from '@auth0/auth0-react'; import React from 'react'; + function LogoutButton(props) { + const { loginWithRedirect } = useAuth0() return (
- +
- ); -}; + ) +} + export default LogoutButton;