diff --git a/datahub-frontend/app/controllers/CentralLogoutController.java b/datahub-frontend/app/controllers/CentralLogoutController.java index b1220c7f3f111..5e24fe9f8220c 100644 --- a/datahub-frontend/app/controllers/CentralLogoutController.java +++ b/datahub-frontend/app/controllers/CentralLogoutController.java @@ -16,7 +16,8 @@ */ @Slf4j public class CentralLogoutController extends LogoutController { - private static final String DEFAULT_BASE_URL_PATH = "/login"; + private static final String AUTH_URL_CONFIG_PATH = "/login"; + private static final String DEFAULT_BASE_URL_PATH = "/"; private static Boolean _isOidcEnabled = false; @Inject @@ -36,8 +37,7 @@ public CentralLogoutController(Config config) { public Result executeLogout(Http.Request request) { if (_isOidcEnabled) { try { - return Results.redirect(DEFAULT_BASE_URL_PATH) - .removingFromSession(request); + return logout(request).toCompletableFuture().get().withNewSession(); } catch (Exception e) { log.error("Caught exception while attempting to perform SSO logout! It's likely that SSO integration is mis-configured.", e); return redirect( @@ -47,7 +47,7 @@ public Result executeLogout(Http.Request request) { .withNewSession(); } } - return Results.redirect(DEFAULT_BASE_URL_PATH) + return Results.redirect(AUTH_URL_CONFIG_PATH) .withNewSession(); } }