Added redirect to login in success.jsp. The other pages are missing this redirect
This commit is contained in:
parent
6c1c9144c2
commit
2bc3eb044e
|
@ -5,6 +5,7 @@ import eu.dnetlib.openaire.user.utils.VerificationActions;
|
|||
import eu.dnetlib.openaire.usermanagement.utils.UrlConstructor;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.web.context.support.SpringBeanAutowiringSupport;
|
||||
|
||||
import javax.servlet.ServletConfig;
|
||||
|
@ -33,6 +34,9 @@ public class ResetPasswordServlet extends HttpServlet {
|
|||
@Autowired
|
||||
private LDAPActions ldapActions;
|
||||
|
||||
@Value("${oidc.home}")
|
||||
private String oidcHomeUrl;
|
||||
|
||||
private Logger logger = Logger.getLogger(ResetPasswordServlet.class);
|
||||
|
||||
@Override
|
||||
|
@ -58,9 +62,17 @@ public class ResetPasswordServlet extends HttpServlet {
|
|||
}
|
||||
|
||||
session.removeAttribute("username");
|
||||
session.setAttribute("homeUrl", oidcHomeUrl);
|
||||
response.sendRedirect(UrlConstructor.getRedirectUrl(request, "success.jsp"));
|
||||
//response.sendRedirect("./success.jsp");
|
||||
printWriter.close();
|
||||
}
|
||||
|
||||
public String getOidcHomeUrl() {
|
||||
return oidcHomeUrl;
|
||||
}
|
||||
|
||||
public void setOidcHomeUrl(String oidcHomeUrl) {
|
||||
this.oidcHomeUrl = oidcHomeUrl;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,9 +12,6 @@ public class UrlConstructor {
|
|||
|
||||
private static final Logger logger = Logger.getLogger(UrlConstructor.class);
|
||||
|
||||
@Value("${oidc.home}")
|
||||
private static String oidcHomeUrl;
|
||||
|
||||
public static String getRedirectUrl(HttpServletRequest request, String jspPage) {
|
||||
|
||||
String scheme = request.getScheme();
|
||||
|
@ -48,9 +45,6 @@ public class UrlConstructor {
|
|||
request.getSession().setAttribute("emailSuccess", "true");
|
||||
}
|
||||
|
||||
request.getSession().setAttribute("homeUrl", oidcHomeUrl);
|
||||
|
||||
logger.info("home Url" + oidcHomeUrl);
|
||||
return resultPath;
|
||||
}
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
%>
|
||||
<%--<META HTTP-EQUIV=Refresh CONTENT="0.5; URL=http://beta.services.openaire.eu/uoa-user-management/openid_connect_login">--%>
|
||||
|
||||
<META HTTP-EQUIV=Refresh CONTENT="0.5; URL=${session.getAttribute("homeUrl")}>
|
||||
<META HTTP-EQUIV=Refresh CONTENT='0.5; URL=<%= session.getAttribute("homeUrl")%>'>
|
||||
<html lang="en-gb" dir="ltr" vocab="http://schema.org/">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
|
|
Loading…
Reference in New Issue