Browse Source

优化双重验证

zhouhao 6 years ago
parent
commit
51bb17d7dc

+ 1 - 1
hsweb-authorization/hsweb-authorization-api/src/main/java/org/hswebframework/web/authorization/twofactor/defaults/HashMapTwoFactorTokenManager.java

@@ -1,6 +1,5 @@
 package org.hswebframework.web.authorization.twofactor.defaults;
 
-import lombok.Setter;
 import org.hswebframework.web.authorization.twofactor.TwoFactorToken;
 import org.hswebframework.web.authorization.twofactor.TwoFactorTokenManager;
 
@@ -19,6 +18,7 @@ public class HashMapTwoFactorTokenManager implements TwoFactorTokenManager {
     private Map<String, WeakReference<TwoFactorTokenInfo>> tokens = new ConcurrentHashMap<>();
 
     private class TwoFactorTokenInfo implements Serializable {
+        private static final long serialVersionUID = -5246224779564760241L;
         private volatile long lastRequestTime = System.currentTimeMillis();
 
         private long timeOut;

+ 1 - 0
hsweb-authorization/hsweb-authorization-basic/src/main/java/org/hswebframework/web/authorization/basic/web/AuthorizationController.java

@@ -110,6 +110,7 @@ public class AuthorizationController {
             eventPublisher.publishEvent(beforeEvent);
             // 验证通过
             Authentication authentication = authenticationManager.authenticate(new PlainTextUsernamePasswordAuthenticationRequest(username, password));
+
             //触发授权成功事件
             AuthorizationSuccessEvent event = new AuthorizationSuccessEvent(authentication, parameterGetter);
             event.getResult().put("userId", authentication.getUser().getId());