Skip to content

Commit 38c426e

Browse files
Update frontend/javascripts/admin/account/account_password_view.tsx
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
1 parent a91f88b commit 38c426e

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

frontend/javascripts/admin/account/account_password_view.tsx

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,17 @@ function AccountPasswordView({ history }: Props) {
2424
function onFinish(formValues: Record<string, any>) {
2525
Request.sendJSONReceiveJSON("/api/auth/changePassword", {
2626
data: formValues,
27-
}).then(async () => {
28-
Toast.success(messages["auth.reset_pw_confirmation"]);
29-
await Request.receiveJSON("/api/auth/logout");
30-
history.push("/auth/login");
31-
Store.dispatch(logoutUserAction());
32-
});
27+
})
28+
.then(async () => {
29+
Toast.success(messages["auth.reset_pw_confirmation"]);
30+
await Request.receiveJSON("/api/auth/logout");
31+
history.push("/auth/login");
32+
Store.dispatch(logoutUserAction());
33+
})
34+
.catch((error) => {
35+
console.error("Password change failed:", error);
36+
Toast.error("Failed to change password. Please try again.");
37+
});
3338
}
3439

3540
function checkPasswordsAreMatching(value: string, otherPasswordFieldKey: string[]) {

0 commit comments

Comments
 (0)