code: @Override
      public void handle(RequestContext context, AuthenticationException e) throws SecurityProviderException,
              IOException {
          String targetUrl = getTargetUrl();
          if (StringUtils.isNotEmpty(targetUrl)) {
              RedirectUtils.redirect(context.getRequest(), context.getResponse(), targetUrl);
          } else {
              sendError(e, context);
          }
      }
docs: Redirects the response to target URL if target URL is not empty. If not, a 401 UNAUTHORIZED error is sent.
  
  @param context the request context
  @param e       the exception that caused the login to fail.