Skip to content

Commit 345f308

Browse files
committed
fix test and form logic
1 parent b875fbf commit 345f308

2 files changed

Lines changed: 1 addition & 7 deletions

File tree

orcid-web/src/main/java/org/orcid/frontend/web/controllers/PasswordResetController.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -313,8 +313,6 @@ public ModelAndView resetPasswordEmail(HttpServletRequest request, @PathVariable
313313
oneTimeResetPasswordForm.setTwoFactorEnabled(true);
314314

315315
if (oneTimeResetPasswordForm.getTwoFactorCode() == null && oneTimeResetPasswordForm.getTwoFactorRecoveryCode() == null) {
316-
oneTimeResetPasswordForm.setPassword(null);
317-
oneTimeResetPasswordForm.setRetypedPassword(null);
318316
return oneTimeResetPasswordForm;
319317
} else {
320318
if (oneTimeResetPasswordForm.getTwoFactorRecoveryCode() != null && !oneTimeResetPasswordForm.getTwoFactorRecoveryCode().isEmpty()) {
@@ -347,7 +345,7 @@ else if (oneTimeResetPasswordForm.getTwoFactorCode() != null && !oneTimeResetPas
347345
String redirectUrl = calculateRedirectUrl(request, response, false);
348346
oneTimeResetPasswordForm.setSuccessRedirectLocation(redirectUrl);
349347
// Remove credentials before return
350-
oneTimeResetPasswordForm.setPassword(null);
348+
oneTimeResetPasswordForm.setNewPassword(null);
351349
oneTimeResetPasswordForm.setRetypedPassword(null);
352350
return oneTimeResetPasswordForm;
353351
}

orcid-web/src/test/java/org/orcid/frontend/web/controllers/PasswordResetControllerTest.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -296,10 +296,6 @@ public void testSubmitPasswordResetV2_PromptsFor2FA() throws Exception {
296296

297297
assertTrue(form.getErrors().isEmpty());
298298
assertTrue(form.isTwoFactorEnabled());
299-
300-
// Assert passwords are wiped when returning to prompt
301-
org.junit.Assert.assertNull(form.getPassword());
302-
org.junit.Assert.assertNull(form.getRetypedPassword());
303299
}
304300

305301
@Test

0 commit comments

Comments
 (0)