From 7fb32cdce412e915c41b8bc918d6d45dcc25eba8 Mon Sep 17 00:00:00 2001 From: manuel rodriguez Date: Fri, 19 Sep 2014 09:35:55 -0400 Subject: [PATCH] Update WMAuthenticationSuccessHandler.java here is a small patch for this file ...the redirect URL seems to be empty string sometimes and this cause that authentication not works please check and hope you can send a patch version for 6.7 regards --- .../runtime/security/WMAuthenticationSuccessHandler.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/wavemaker/wavemaker-runtime/src/main/java/com/wavemaker/runtime/security/WMAuthenticationSuccessHandler.java b/wavemaker/wavemaker-runtime/src/main/java/com/wavemaker/runtime/security/WMAuthenticationSuccessHandler.java index 8760295199..00434a25d6 100644 --- a/wavemaker/wavemaker-runtime/src/main/java/com/wavemaker/runtime/security/WMAuthenticationSuccessHandler.java +++ b/wavemaker/wavemaker-runtime/src/main/java/com/wavemaker/runtime/security/WMAuthenticationSuccessHandler.java @@ -77,12 +77,14 @@ public void onAuthenticationSuccess(HttpServletRequest request, } clearAuthenticationAttributes(request); - - if (redirectURL == null || redirectURL.isEmpty()){ + if (redirectURL == null){ System.out.println("No redirectUrl, throw"); throw new IOException("Unable to determine a redirect URL"); } - System.out.println("redirect URL IS: " + redirectURL); + if(redirectURL.isEmpty()){ + redirectURL="/"; + } + System.out.println("redirect URL IS: " + redirectURL); RedirectStrategy rs = getRedirectStrategy(); if(rs instanceof WMHashAwareRedirectStrategy){ redirectURL = ((WMHashAwareRedirectStrategy)rs).getHashAwareRedirectUrl(request,redirectURL); @@ -106,4 +108,3 @@ private boolean isAjaxRequest(HttpServletRequest request) { return "XMLHttpRequest".equals(request.getHeader("X-Requested-With")); } } -