Skip to content

Commit

Permalink
chore: update logic
Browse files Browse the repository at this point in the history
  • Loading branch information
ccatherinetan committed May 7, 2024
1 parent f09f567 commit 9e0ce71
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/app/(auth)/login/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ export default function Login() {
const validEmail = (e: string) => e !== '' && isEmail(e);

useEffect(() => {
if (!auth || !auth.userId) return;
push(CONFIG.settings);
if (auth && auth.userId) push(CONFIG.settings);
}, [auth, profile, push]);

const handleSignIn = async () => {
Expand All @@ -50,7 +49,7 @@ export default function Login() {
} else {
profile?.loadProfile();
setErrorMessage('');
// conditional routing after log in
// conditional routing after logging in
if (!profile?.profileData) push(CONFIG.onboardingHome);
else if (profile.roles.map(r => r.role).includes('ATTORNEY'))
push(CONFIG.cases);
Expand Down

0 comments on commit 9e0ce71

Please sign in to comment.