mgt sso
This commit is contained in:
shimingxy
2019-12-02 11:55:20 +08:00
parent 40bef5723d
commit c1a82ab45b
7 changed files with 50 additions and 56 deletions

View File

@@ -99,6 +99,9 @@ public class LoginEndpoint {
}else {
WebContext.setAttribute(WebConstants.SPRING_PROCESS_SAVED_REQUEST, firstSavedRequest);
}
if(WebContext.isAuthenticated()){
return WebContext.redirect("/main");
}
modelAndView.setViewName("login");
return modelAndView;
}
@@ -106,11 +109,10 @@ public class LoginEndpoint {
@RequestMapping(value={"/logon.do"})
public ModelAndView logon(@ModelAttribute("authentication") BasicAuthentication authentication) {
authenticationProvider.authenticate(authentication);
if(WebContext.isAuthenticated()){
return WebContext.redirect("/main");
}else{
authenticationProvider.authenticate(authentication);
return WebContext.redirect("/login");
}
}