Selaa lähdekoodia

Updated the UserInfoBean with the new OTP record as it gets changed.

Without this change, the user would have to log out and log back in again if he wanted to check a valid code.
James Albright 9 vuotta sitten
vanhempi
commit
29b563e404
1 muutettua tiedostoa jossa 3 lisäystä ja 0 poistoa
  1. 3 0
      src/main/java/password/pwm/http/servlet/SetupOtpServlet.java

+ 3 - 0
src/main/java/password/pwm/http/servlet/SetupOtpServlet.java

@@ -210,6 +210,9 @@ public class SetupOtpServlet extends AbstractPwmServlet {
                 );
                 otpBean.setWritten(true);
 
+                // Update the current user info bean, so the user can check the code right away
+                pwmSession.getUserInfoBean().setOtpUserRecord(otpBean.getOtpUserRecord());
+
                 // mark the event log
                 final UserAuditRecord auditRecord = new AuditRecordFactory(pwmRequest).createUserAuditRecord(
                         AuditEvent.SET_OTP_SECRET,