diff --git a/app/src/App.tsx b/app/src/App.tsx index f98fdb6..ccf1ac9 100644 --- a/app/src/App.tsx +++ b/app/src/App.tsx @@ -6,15 +6,17 @@ import MenteeDashboard from "./pages/MenteeDashboard"; import CreateWorkshop from "./pages/CreateWorkshop"; import CreateMeeting from "./pages/CreateMeeting"; import AuthCallback from "./pages/auth-callback"; +import LoginRedirect from "./pages/LoginRedirect"; function App(): ReactElement { return (
+ } /> } /> } /> } /> - }/> + } /> } /> } /> } /> diff --git a/app/src/pages/LoginRedirect.tsx b/app/src/pages/LoginRedirect.tsx new file mode 100644 index 0000000..ccc093a --- /dev/null +++ b/app/src/pages/LoginRedirect.tsx @@ -0,0 +1,18 @@ +import { useEffect } from "react"; +import { useAuth0 } from "@auth0/auth0-react"; + +const LoginRedirect = () => { + const { loginWithRedirect } = useAuth0(); + + useEffect(() => { + loginWithRedirect({ + appState: { + returnTo: "/home", + }, + }); + }, [loginWithRedirect]); + + return null; +}; + +export default LoginRedirect;