NIHVIVO-1568 If a user clicks on the Login link, or tries to access a restricted page, any previous login process is cancelled and a new one is begun.
This commit is contained in:
parent
7c5b296476
commit
7b62bdd0a2
1 changed files with 24 additions and 0 deletions
|
@ -89,6 +89,9 @@ public class Authenticate extends VitroHttpServlet {
|
|||
VitroRequest vreq = new VitroRequest(request);
|
||||
|
||||
try {
|
||||
if (loginProcessIsRestarting(vreq)) {
|
||||
LoginProcessBean.removeBean(vreq);
|
||||
}
|
||||
if (loginProcessPagesAreEmpty(vreq)) {
|
||||
recordLoginProcessPages(vreq);
|
||||
}
|
||||
|
@ -138,6 +141,23 @@ public class Authenticate extends VitroHttpServlet {
|
|||
|
||||
}
|
||||
|
||||
/**
|
||||
* The after-login page or the return flag are supplied only on the first
|
||||
* step in the process. If we see either of them, we conclude that the user
|
||||
* has re-started the login.
|
||||
*/
|
||||
private boolean loginProcessIsRestarting(HttpServletRequest request) {
|
||||
if (isAfterLoginParameterSet(request)) {
|
||||
log.debug("after-login parameter is set: restarting the login.");
|
||||
return true;
|
||||
}
|
||||
if (isReturnParameterSet(request)) {
|
||||
log.debug("return parameter is set: restarting the login.");
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Once these URLs have been set, don't change them.
|
||||
*/
|
||||
|
@ -191,6 +211,10 @@ public class Authenticate extends VitroHttpServlet {
|
|||
}
|
||||
}
|
||||
|
||||
private boolean isAfterLoginParameterSet(HttpServletRequest request) {
|
||||
return (null != request.getParameter(PARAMETER_AFTER_LOGIN));
|
||||
}
|
||||
|
||||
private boolean isReturnParameterSet(HttpServletRequest request) {
|
||||
return (null != request.getParameter(PARAMETER_RETURN));
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue