dengzhhu653 commented on code in PR #5561:
URL: https://github.com/apache/hive/pull/5561#discussion_r1877233323
##########
service/src/java/org/apache/hive/service/servlet/LDAPAuthenticationFilter.java:
##########
@@ -44,29 +46,28 @@ public LDAPAuthenticationFilter(LdapAuthService
ldapAuthService) {
public void doFilter(ServletRequest request, ServletResponse response,
FilterChain chain)
throws IOException, ServletException {
-
HttpServletRequest httpRequest = (HttpServletRequest) request;
- String requestURI = httpRequest.getRequestURI();
-
- boolean isLoginFormRequest = requestURI.endsWith(LOGIN_FORM_URI);
- boolean isLoginServletRequest = requestURI.endsWith(LOGIN_SERVLET_URI);
boolean isLoggedIn = ldapAuthService.authenticate(httpRequest,
(HttpServletResponse) response);
-
- if (isLoggedIn && (isLoginFormRequest || isLoginServletRequest)) {
- // User is already logged in, and is trying to login again; forward to
the main homepage
- RequestDispatcher dispatcher =
request.getRequestDispatcher(HiveServer2.HS2_WEBUI_ROOT_URI);
+ boolean forwardRequest = (isLoginRequest(httpRequest) && isLoggedIn) ||
(!isLoginRequest(httpRequest) && !isLoggedIn);
Review Comment:
done
--
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]