Browse Source

Consider too long user inputs for username login field

Signed-off-by: Pekka Helenius <fincer89@hotmail.com>
v0.0.3-alpha
Pekka Helenius 4 years ago
parent
commit
5e043c3a69
1 changed files with 6 additions and 4 deletions
  1. +6
    -4
      bookstore/src/main/java/com/fjordtek/bookstore/service/session/BookStoreAuthenticationFailureHandler.java

+ 6
- 4
bookstore/src/main/java/com/fjordtek/bookstore/service/session/BookStoreAuthenticationFailureHandler.java View File

@ -47,10 +47,12 @@ public class BookStoreAuthenticationFailureHandler implements AuthenticationFail
responseData.setStatus(HttpServletResponse.SC_UNAUTHORIZED); responseData.setStatus(HttpServletResponse.SC_UNAUTHORIZED);
httpServerLogger.log(requestData, responseData); httpServerLogger.log(requestData, responseData);
requestData
.setAttribute("username", requestData.getParameter(
env.getProperty("auth.field.username")
));
String username = requestData.getParameter(env.getProperty("auth.field.username"));
if (username.length() > 50) {
username = username.substring(0, 50) + " ...";
}
requestData.setAttribute("username", username);
requestData requestData
.setAttribute("authfailure", msg.getMessage( .setAttribute("authfailure", msg.getMessage(


Loading…
Cancel
Save