difin commented on code in PR #5561:
URL: https://github.com/apache/hive/pull/5561#discussion_r1868085897
##########
service/src/java/org/apache/hive/service/servlet/LoginServlet.java:
##########
@@ -36,11 +36,17 @@ public LoginServlet(LdapAuthService ldapAuthService) {
@Override
public void doPost(HttpServletRequest request, HttpServletResponse response)
{
- ldapAuthService.authenticate(request, response);
- RequestDispatcher dispatcher =
request.getRequestDispatcher(HiveServer2.HS2_WEBUI_ROOT_URI);
+ boolean success = ldapAuthService.authenticate(request, response);
PrintWriter out = null;
try {
out = response.getWriter();
+ final RequestDispatcher dispatcher;
+ if (success) {
+ dispatcher =
request.getRequestDispatcher(HiveServer2.HS2_WEBUI_ROOT_URI);
+ } else {
+ request.setAttribute("login_failure_message", "Invalid username or
password");
Review Comment:
`login_failure_message` is used in 2 places, it would be better to define it
as a constant.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]