mirror of https://github.com/apache/nifi.git
NIFI-2822 - pass the JWT Authorization token i. This closes #1065
This commit is contained in:
parent
8868235993
commit
30f008d676
|
@ -31,6 +31,8 @@
|
|||
<script type="text/javascript" src="../nifi/js/codemirror/addon/lint/lint.js"></script>
|
||||
<script type="text/javascript" src="../nifi/js/codemirror/addon/lint/json-lint.js"></script>
|
||||
<script type="text/javascript" src="../nifi/js/jsonlint/jsonlint.min.js"></script>
|
||||
<script type="text/javascript" src="../nifi/js/nf/nf-namespace.js"></script>
|
||||
<script type="text/javascript" src="../nifi/js/nf/nf-storage.js"></script>
|
||||
<script type="text/javascript" src="../nifi/assets/angular/angular.min.js"></script>
|
||||
<script type="text/javascript" src="../nifi/assets/angular-animate/angular-animate.min.js"></script>
|
||||
<script type="text/javascript" src="../nifi/assets/angular-aria/angular-aria.min.js"></script>
|
||||
|
|
|
@ -17,7 +17,12 @@
|
|||
|
||||
'use strict';
|
||||
|
||||
var AppRun = function($rootScope,$state){
|
||||
var AppRun = function($rootScope,$state,$http){
|
||||
|
||||
if (nf.Storage.hasItem('jwt')) {
|
||||
var token = nf.Storage.getItem('jwt');
|
||||
$http.defaults.headers.common.Authorization = 'Bearer ' + token;
|
||||
}
|
||||
|
||||
$rootScope.$on('$stateChangeError', function(event, toState, toParams, fromState, fromParams, error){
|
||||
event.preventDefault();
|
||||
|
@ -35,7 +40,7 @@ var AppConfig = function ($urlRouterProvider) {
|
|||
|
||||
};
|
||||
|
||||
AppRun.$inject = ['$rootScope','$state'];
|
||||
AppRun.$inject = ['$rootScope','$state','$http'];
|
||||
|
||||
AppConfig.$inject = ['$urlRouterProvider'];
|
||||
|
||||
|
|
Loading…
Reference in New Issue