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: gitbox-unsubscr...@hive.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org
For additional commands, e-mail: gitbox-h...@hive.apache.org

Reply via email to