Skip to content

Instantly share code, notes, and snippets.

@mucahitgurbuz
Created August 18, 2021 17:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mucahitgurbuz/7abf76f81be86742edabb3fc8f37f54b to your computer and use it in GitHub Desktop.
Save mucahitgurbuz/7abf76f81be86742edabb3fc8f37f54b to your computer and use it in GitHub Desktop.
Authentication page for Auth0 react.
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