Skip to content

Commit

Permalink
trying to debug prod 3
Browse files Browse the repository at this point in the history
  • Loading branch information
subru-37 committed Jan 12, 2025
1 parent ace9324 commit 2f1bf20
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions apps/web-admin/src/pages/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,17 @@ function Dashboard() {
const router = useRouter();
const { user, isAuthenticated, isLoading, loginWithRedirect } = useAuth0();
const { accountDetails } = useContext(account);
// useEffect(() => {
// if (isAuthenticated) {
// router.push(`/${accountDetails.orgId}/events`);
// }
// }, [router.pathname]);
useEffect(() => {
console.log(accountDetails);
if (
accountDetails &&
accountDetails.orgId &&
router.asPath !== `/${accountDetails.orgId}/events`
) {
// // //console.log('route')
router.replace(`/${accountDetails.orgId}/events`);
}
}, [isAuthenticated, accountDetails]);

return <DashboardLayout>{!isAuthenticated && <Landing />}</DashboardLayout>;
}
Expand Down

0 comments on commit 2f1bf20

Please sign in to comment.