瀏覽代碼

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 年之前
父節點
當前提交
29b563e404
共有 1 個文件被更改,包括 3 次插入0 次删除
  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,