Commit 44dac4a6 authored by Sascha Herzinger's avatar Sascha Herzinger
Browse files

jsonify authentication success response

parent 905b01e2
......@@ -8,6 +8,7 @@ import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -56,9 +57,11 @@ public class AuthenticationSuccessHandlerImpl implements AuthenticationSuccessHa
result.put("token", request.getSession().getId());
result.put("login", user.getLogin());
request.getSession().setMaxInactiveInterval(Configuration.getSessionLength());
String json = new ObjectMapper().writeValueAsString(result);
response.setContentType("application/json");
response.getWriter().print(result);
response.getWriter().print(json);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment