Skip to content

Commit

Permalink
fix response status check
Browse files Browse the repository at this point in the history
  • Loading branch information
Ashesh3 committed Oct 6, 2023
1 parent 75dceaa commit 1230555
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Components/Auth/Login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ export const Login = (props: { forgot?: boolean }) => {
body: { ...valid },
});
setLoading(false);
if (res && res.statusText === "OK") {
if (res?.ok) {
Notification.Success({
msg: t("password_sent"),
});
Expand Down
4 changes: 2 additions & 2 deletions src/Components/Auth/ResetPassword.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export const ResetPassword = (props: any) => {
const { res, error } = await request(routes.resetPassword, {
body: { ...valid },
});
if (res && res.statusText === "OK") {
if (res?.ok) {
localStorage.removeItem(LocalStorageKeys.accessToken);
Notification.Success({
msg: t("password_reset_success"),
Expand All @@ -89,7 +89,7 @@ export const ResetPassword = (props: any) => {
const { res } = await request(routes.checkResetToken, {
body: { token: props.token },
});
if (!res || res.statusText !== "OK") {
if (!res || res.ok) {
navigate("/invalid-reset");
}
};
Expand Down

0 comments on commit 1230555

Please sign in to comment.