mirror of
https://gitee.com/dromara/MaxKey.git
synced 2025-12-07 17:38:32 +08:00
RemeberMe fix
This commit is contained in:
parent
6e62782bc7
commit
c70aa8df95
@ -1,7 +1,6 @@
|
||||
package org.maxkey.authn;
|
||||
|
||||
import org.maxkey.authn.realm.AbstractAuthenticationRealm;
|
||||
import org.maxkey.authn.support.jwt.JwtLoginService;
|
||||
import org.maxkey.authn.support.rememberme.AbstractRemeberMeService;
|
||||
import org.maxkey.config.ApplicationConfig;
|
||||
import org.maxkey.constants.LOGINTYPE;
|
||||
@ -47,10 +46,6 @@ public abstract class AbstractAuthenticationProvider{
|
||||
@Qualifier("remeberMeService")
|
||||
protected AbstractRemeberMeService remeberMeService;
|
||||
|
||||
/* @Autowired
|
||||
@Qualifier("jwtLoginService")
|
||||
JwtLoginService jwtLoginService;
|
||||
*/
|
||||
protected abstract String getProviderName();
|
||||
|
||||
protected abstract Authentication doInternalAuthenticate(Authentication authentication);
|
||||
|
||||
@ -60,7 +60,9 @@ public class RealmAuthenticationProvider extends AbstractAuthenticationProvider
|
||||
*/
|
||||
WebContext.setUserInfo(userInfo);
|
||||
|
||||
if(applicationConfig.getLoginConfig().isRemeberMe()){
|
||||
auth.setAuthenticated(true);
|
||||
|
||||
if(auth.isAuthenticated()&&applicationConfig.getLoginConfig().isRemeberMe()){
|
||||
if(auth.getJ_remeberme()!=null&&auth.getJ_remeberme().equals("remeberMe")){
|
||||
WebContext.getSession().setAttribute(WebConstants.REMEBER_ME_SESSION,auth.getJ_username());
|
||||
_logger.debug("do Remeber Me");
|
||||
@ -71,7 +73,6 @@ public class RealmAuthenticationProvider extends AbstractAuthenticationProvider
|
||||
}
|
||||
}
|
||||
|
||||
auth.setAuthenticated(true);
|
||||
UsernamePasswordAuthenticationToken usernamePasswordAuthenticationToken =new UsernamePasswordAuthenticationToken(
|
||||
auth,
|
||||
"PASSWORD",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user