ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alexantone...@apache.org
Subject [2/3] ambari git commit: AMBARI-16987. After relogin get the same page was before logout instead of Dashboard (alexantonenko)
Date Wed, 01 Jun 2016 17:25:51 GMT
AMBARI-16987. After relogin get the same page was before logout instead of Dashboard (alexantonenko)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/babe17df
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/babe17df
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/babe17df

Branch: refs/heads/branch-2.4
Commit: babe17dffd45ebc0e8969f4ad04df8a159a00b59
Parents: 9029858
Author: Alex Antonenko <hiveww@gmail.com>
Authored: Wed Jun 1 18:48:28 2016 +0300
Committer: Alex Antonenko <hiveww@gmail.com>
Committed: Wed Jun 1 20:25:43 2016 +0300

----------------------------------------------------------------------
 ambari-web/app/router.js | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/babe17df/ambari-web/app/router.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/router.js b/ambari-web/app/router.js
index 496e3d3..b7ba2cb 100644
--- a/ambari-web/app/router.js
+++ b/ambari-web/app/router.js
@@ -597,7 +597,8 @@ App.Router = Em.Router.extend({
         name: 'router.logoff',
         sender: this,
         success: 'logOffSuccessCallback',
-        error: 'logOffErrorCallback'
+        error: 'logOffErrorCallback',
+        beforeSend: 'logOffBeforeSend'
       }).complete(function() {
         self.logoffRedirect(context);
       });
@@ -615,16 +616,21 @@ App.Router = Em.Router.extend({
 
   },
 
+  logOffBeforeSend: function(opt, xhr) {
+    xhr.setRequestHeader('Authorization', '');
+  },
+
   /**
    * Redirect function on sign off request.
    *
    * @param {$.Event} [context=undefined] - triggered event context
    */
   logoffRedirect: function(context) {
+    this.transitionTo('login', context);
     if (App.router.get('clusterController.isLoaded')) {
-      window.location.reload();
-    } else {
-      this.transitionTo('login', context);
+      Em.run.next(function() {
+        window.location.reload();
+      });
     }
   },
 


Mime
View raw message