brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From neykov <...@git.apache.org>
Subject [GitHub] brooklyn-ui pull request #30: BROOKLYN-323: Improve logout script
Date Mon, 08 Aug 2016 13:55:24 GMT
Github user neykov commented on a diff in the pull request:

    https://github.com/apache/brooklyn-ui/pull/30#discussion_r73878672
  
    --- Diff: src/main/webapp/assets/js/util/brooklyn-utils.js ---
    @@ -175,17 +175,22 @@ define([
         };
     
         Util.logout = function logout() {
    -        $.ajax({
    -            type: "POST",
    -            dataType: "text",
    -            url: "/v1/logout",
    -            success: function() {
    -                window.location.replace("/");
    -            },
    -            failure: function() {
    -                window.location.replace("/");
    -            }
    -        });
    +        var ua = window.navigator.userAgent;
    +        if (ua.indexOf("MSIE ") > 0 || ua.indexOf(" Edge/") > 0 || ua.indexOf("
Trident/") > 0) {
    +            $.ajax({
    +                async: false,
    +                type: "GET",
    +                dataType: "text",
    +                url: "/v1/logout"
    +            });
    +            document.execCommand('ClearAuthenticationCache', 'false');
    --- End diff --
    
    Instead of doing a user agent check can we call `ClearAuthenticationCache` in a try-catch
and use the code below for all browsers?


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message