Skip to content

Commit

Permalink
Merge branch 'coronasafe:develop' into fix#6360
Browse files Browse the repository at this point in the history
  • Loading branch information
konavivekramakrishna authored Oct 6, 2023
2 parents 1ab65b7 + 91abee0 commit d09cd54
Show file tree
Hide file tree
Showing 3 changed files with 6 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
3 changes: 3 additions & 0 deletions src/Redux/api.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,20 +63,23 @@ const routes = {
checkResetToken: {
path: "/api/v1/password_reset/check/",
method: "POST",
noAuth: true,
TRes: Type<Record<string, never>>(),
TBody: Type<{ token: string }>(),
},

resetPassword: {
path: "/api/v1/password_reset/confirm/",
method: "POST",
noAuth: true,
TRes: Type<Record<string, never>>(),
TBody: Type<{ password: string; confirm: string }>(),
},

forgotPassword: {
path: "/api/v1/password_reset/",
method: "POST",
noAuth: true,
TRes: Type<Record<string, never>>(),
TBody: Type<{ username: string }>(),
},
Expand Down

0 comments on commit d09cd54

Please sign in to comment.