diff --git a/bookstore/src/main/java/com/fjordtek/bookstore/service/session/BookStoreAuthenticationFailureHandler.java b/bookstore/src/main/java/com/fjordtek/bookstore/service/session/BookStoreAuthenticationFailureHandler.java index 0856855..3f848b6 100644 --- a/bookstore/src/main/java/com/fjordtek/bookstore/service/session/BookStoreAuthenticationFailureHandler.java +++ b/bookstore/src/main/java/com/fjordtek/bookstore/service/session/BookStoreAuthenticationFailureHandler.java @@ -47,10 +47,12 @@ public class BookStoreAuthenticationFailureHandler implements AuthenticationFail responseData.setStatus(HttpServletResponse.SC_UNAUTHORIZED); 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 .setAttribute("authfailure", msg.getMessage(