Merge pull request #289 from the-luap/fix/password-change-regular-modal

fix: apply password change fix to regular modal + longer toast delay (#263)
This commit is contained in:
Paul Nothaft
2026-04-09 16:06:13 +02:00
committed by GitHub
2 changed files with 7 additions and 9 deletions
@@ -32,7 +32,7 @@ export const MandatoryPasswordChangeModal: React.FC = () => {
// where the auth context checks the session before the cookie is stored.
setTimeout(() => {
window.location.href = '/admin/dashboard';
}, 500);
}, 2000);
},
onError: (error: any) => {
if (error.response?.data?.error) {
@@ -30,14 +30,12 @@ export const PasswordChangeModal: React.FC<PasswordChangeModalProps> = ({ isOpen
mutationFn: adminService.changePassword,
onSuccess: () => {
toast.success(t('passwordChange.success'));
onClose();
// Reset form
setFormData({
currentPassword: '',
newPassword: '',
confirmPassword: ''
});
setErrors({});
// Full page reload so the browser picks up the new JWT cookie.
// Same fix as MandatoryPasswordChangeModal — without this, the old
// token gets rejected and causes a redirect loop.
setTimeout(() => {
window.location.href = '/admin/dashboard';
}, 2000);
},
onError: (error: any) => {
if (error.response?.data?.error) {