Browse Source

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 8 years ago
parent
commit
29b563e404
1 changed files with 3 additions and 0 deletions
  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,