From fdaf76c2a948f25d4deead1d4205aa2df307ba2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francisco=20Javier=20Mart=C3=ADnez?= Date: Fri, 5 Apr 2024 11:31:42 +0200 Subject: [PATCH] Feat/avoid password change link expiration on previous requests (#169) Only execute password reset on GET method to avoid link expiration on check requests. --- .../src/main/webapp/linkEmailVerification.jsp | 53 ++++++++----------- 1 file changed, 21 insertions(+), 32 deletions(-) diff --git a/tntconcept-web/src/main/webapp/linkEmailVerification.jsp b/tntconcept-web/src/main/webapp/linkEmailVerification.jsp index 7012b450..23e7aa03 100755 --- a/tntconcept-web/src/main/webapp/linkEmailVerification.jsp +++ b/tntconcept-web/src/main/webapp/linkEmailVerification.jsp @@ -1,41 +1,30 @@ - -<%@page language="java" contentType="text/html; charset=UTF-8"%> -<%@page import="com.autentia.tnt.util.*,com.autentia.tnt.manager.security.*"%> +<%@page contentType="text/html; charset=UTF-8" %> +<%@ page import="java.util.Objects, com.autentia.tnt.bean.LinkBean" %> <%@include file="/inc/tlibs.jsp" %> -<%@page import="com.autentia.tnt.bean.LinkBean"%> - - + - - - -<%@include file="/inc/publicHeader.jsp"%> - - - <%@include file="/inc/uiCore.jsp"%> - + + <%@include file="/inc/uiCore.jsp" %> - - - - - - - <% - String link = request.getParameter("link"); - LinkBean linkBean = new LinkBean(); - String password = linkBean.checkLinkAndResetPassword(link); + + <%@include file="/inc/publicHeader.jsp" %> + + <% + String method = request.getMethod(); + if (Objects.equals(method, "GET")) { + String link = request.getParameter("link"); + LinkBean linkBean = new LinkBean(); + String password = linkBean.checkLinkAndResetPassword(link); %> - -
-
-

<%= password %>

-
- + +
+

<%= password %>

+
+ <% } %> -
- +
+