소스 검색

AMBARI-16987. After relogin get the same page was before logout instead of Dashboard (alexantonenko)

Alex Antonenko 9 년 전
부모
커밋
babe17dffd
1개의 변경된 파일10개의 추가작업 그리고 4개의 파일을 삭제
  1. 10 4
      ambari-web/app/router.js

+ 10 - 4
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();
+      });
     }
   },