|
@@ -19,9 +19,11 @@ package org.apache.ambari.server.api.services;
|
|
|
|
|
|
import org.springframework.security.core.context.SecurityContextHolder;
|
|
|
|
|
|
+import javax.servlet.http.HttpServletRequest;
|
|
|
import javax.ws.rs.GET;
|
|
|
import javax.ws.rs.Path;
|
|
|
import javax.ws.rs.Produces;
|
|
|
+import javax.ws.rs.core.Context;
|
|
|
import javax.ws.rs.core.Response;
|
|
|
|
|
|
/**
|
|
@@ -32,8 +34,9 @@ public class LogoutService {
|
|
|
|
|
|
@GET
|
|
|
@Produces("text/plain")
|
|
|
- public Response performLogout() {
|
|
|
+ public Response performLogout(@Context HttpServletRequest servletRequest) {
|
|
|
SecurityContextHolder.clearContext();
|
|
|
+ servletRequest.getSession().invalidate();
|
|
|
return Response.status(Response.Status.OK).build();
|
|
|
}
|
|
|
|