Skip to content

Commit

Permalink
Implement immediate redirection after successful login
Browse files Browse the repository at this point in the history
  • Loading branch information
bodhish committed Jan 6, 2025
1 parent 6956474 commit 9a839bd
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/components/Auth/Login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ const Login = (props: LoginProps) => {
},
onSuccess: ({ res }) => {
setCaptcha(res?.status === 429);
window.location.href = "/";
},
});

Expand Down Expand Up @@ -160,10 +161,7 @@ const Login = (props: LoginProps) => {
createdAt: new Date().toISOString(),
};
localStorage.setItem(CarePatientTokenKey, JSON.stringify(tokenData));
Notification.Success({ msg: t("verify_otp_success_login") });
setTimeout(() => {
window.location.href = "/patient/home";
}, 200);
window.location.href = "/patient/home";
}
},

Expand Down

0 comments on commit 9a839bd

Please sign in to comment.