-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat/avoid password change link expiration on previous requests (#169)
Only execute password reset on GET method to avoid link expiration on check requests.
- Loading branch information
Showing
1 changed file
with
21 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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"%> | ||
|
||
|
||
<f:loadBundle basename="com.autentia.tnt.resources.messages" var="msg" /> | ||
<f:loadBundle basename="com.autentia.tnt.resources.messages" var="msg"/> | ||
<html> | ||
|
||
<f:view> | ||
|
||
<%@include file="/inc/publicHeader.jsp"%> | ||
|
||
<head> | ||
<%@include file="/inc/uiCore.jsp"%> | ||
|
||
<head title=""> | ||
<%@include file="/inc/uiCore.jsp" %> | ||
</head> | ||
<html> | ||
<head> | ||
<title> | ||
</title> | ||
</head> | ||
<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"> | ||
<% | ||
String link = request.getParameter("link"); | ||
LinkBean linkBean = new LinkBean(); | ||
String password = linkBean.checkLinkAndResetPassword(link); | ||
<f:view> | ||
<%@include file="/inc/publicHeader.jsp" %> | ||
<body marginwidth="0" marginheight="0"> | ||
<% | ||
String method = request.getMethod(); | ||
if (Objects.equals(method, "GET")) { | ||
String link = request.getParameter("link"); | ||
LinkBean linkBean = new LinkBean(); | ||
String password = linkBean.checkLinkAndResetPassword(link); | ||
%> | ||
|
||
<div align="center" style="top:50px"> | ||
<br> | ||
<p><%= password %></p> | ||
</div> | ||
|
||
|
||
<div style="top:50px; text-align: center"> | ||
<p><%= password %></p> | ||
</div> | ||
<% } %> | ||
</body> | ||
</f:view> | ||
</f:view> | ||
|
||
</html> | ||
|
||
|