사용자 계정 쿠키 저장 추가

master
mjkhan21 1 year ago
parent 115f1a3213
commit 807e1adafe

@ -30,17 +30,16 @@ public class AuthenticationSuccess extends SavedRequestAwareAuthenticationSucces
@Resource(name="objectMapper") @Resource(name="objectMapper")
private ObjectMapper objectMapper; private ObjectMapper objectMapper;
private boolean rememberCredentials; /**private boolean rememberCredentials;
* .
/** .
* @param remember * @param remember
* <ul><li> true</li> * <ul><li> true</li>
* <li> false</li> * <li> false</li>
* </ul> * </ul>
*/
public void setRememberCredentials(boolean remember) { public void setRememberCredentials(boolean remember) {
this.rememberCredentials = remember; this.rememberCredentials = remember;
} }
*/
/** . /** .
* @return * @return
@ -84,8 +83,10 @@ public class AuthenticationSuccess extends SavedRequestAwareAuthenticationSucces
} }
private void remember(UserInfo user, HttpServletRequest hreq, HttpServletResponse hresp) { private void remember(UserInfo user, HttpServletRequest hreq, HttpServletResponse hresp) {
boolean remember = rememberCredentials && "true".equals(hreq.getParameter("remember")); boolean remember = "true".equals(hreq.getParameter("rememberCredentials"));
// boolean remember = rememberCredentials && "true".equals(hreq.getParameter("remember"));
addCookie(hresp, remember, "userAccount", user.getAccount()); addCookie(hresp, remember, "userAccount", user.getAccount());
addCookie(hresp, remember, "userInstitute", user.getInstitute());
} }
private void addCookie(HttpServletResponse hresp, boolean remember, String name, String value) { private void addCookie(HttpServletResponse hresp, boolean remember, String name, String value) {

Loading…
Cancel
Save