Created
August 18, 2021 17:12
-
-
Save mucahitgurbuz/7abf76f81be86742edabb3fc8f37f54b to your computer and use it in GitHub Desktop.
Authentication page for Auth0 react.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useEffect } from 'react'; | |
import { useAuth0 } from '../../../auth/auth0'; | |
import { urls } from '../../../routers/urls'; | |
const Login: React.FC = () => { | |
const { loginWithRedirect, loading } = useAuth0(); | |
useEffect(() => { | |
if (!loading) { | |
loginWithRedirect({ appState: urls.orderManagement }); | |
} | |
}, [loading]); | |
return null; | |
}; | |
export default Login; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment