Github user bostko commented on a diff in the pull request:

    https://github.com/apache/brooklyn-server/pull/288#discussion_r74571173
  
    --- Diff: 
rest/rest-resources/src/main/java/org/apache/brooklyn/rest/resources/LogoutResource.java
 ---
    @@ -37,32 +37,45 @@
         @Context UriInfo uri;
     
         @Override
    +    public Response redirectToLogout() {
    +        URI dest = uri.getBaseUriBuilder().path(LogoutApi.class).build();
    +
    +        // Return response with Javascript which will make an asynchronous 
POST request to the logout method.
    +        // (When calling logout it is important to use wrong username and 
password in order to make browser forget the old ones)
    +        return Response.status(Status.OK)
    +                .entity(String.format("<!DOCTYPE html>\n<body>\n" +
    +                        "<script>\n" +
    +                        "var a=new window.XMLHttpRequest;" +
    +                        "a.open('POST','%1$s',0,'user','wrong'+(new 
Date).getTime().toString());a.send(\"\");\n" +
    +                        "window.location.href='/';</script></body>", 
dest.toASCIIString()))
    +                .build();
    --- End diff --
    
    This is needed to reload the whole DOM.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to