mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 15:17:25 +01:00
Move header assignment to app level
This commit is contained in:
@@ -255,4 +255,6 @@ window.habitrpg = angular.module('habitrpg',
|
|||||||
$httpProvider.defaults.headers.common['x-api-user'] = settings.auth.apiId;
|
$httpProvider.defaults.headers.common['x-api-user'] = settings.auth.apiId;
|
||||||
$httpProvider.defaults.headers.common['x-api-key'] = settings.auth.apiToken;
|
$httpProvider.defaults.headers.common['x-api-key'] = settings.auth.apiToken;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$httpProvider.defaults.headers.common['x-client'] = 'habitica-web';
|
||||||
}]);
|
}]);
|
||||||
|
|||||||
@@ -9,8 +9,6 @@ angular.module('habitrpg')
|
|||||||
function($scope, $rootScope, User, $http, $location, $window, ApiUrl, $modal, Analytics) {
|
function($scope, $rootScope, User, $http, $location, $window, ApiUrl, $modal, Analytics) {
|
||||||
$scope.Analytics = Analytics;
|
$scope.Analytics = Analytics;
|
||||||
|
|
||||||
$http.defaults.headers.common['x-client'] = 'habitica-web';
|
|
||||||
|
|
||||||
$scope.logout = function() {
|
$scope.logout = function() {
|
||||||
localStorage.clear();
|
localStorage.clear();
|
||||||
window.location.href = '/logout';
|
window.location.href = '/logout';
|
||||||
|
|||||||
@@ -36,8 +36,6 @@ habitrpg.controller("RootCtrl", ['$scope', '$rootScope', '$location', 'User', '$
|
|||||||
$rootScope.toJson = angular.toJson;
|
$rootScope.toJson = angular.toJson;
|
||||||
$rootScope.Payments = Payments;
|
$rootScope.Payments = Payments;
|
||||||
|
|
||||||
$http.defaults.headers.common['x-client'] = 'habitica-web';
|
|
||||||
|
|
||||||
// Angular UI Router
|
// Angular UI Router
|
||||||
$rootScope.$state = $state;
|
$rootScope.$state = $state;
|
||||||
$rootScope.$stateParams = $stateParams;
|
$rootScope.$stateParams = $stateParams;
|
||||||
|
|||||||
@@ -19,6 +19,8 @@ window.habitrpg = angular.module('habitrpg', ['chieffancypants.loadingBar', 'ui.
|
|||||||
});
|
});
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$http.defaults.headers.common['x-client'] = 'habitica-web';
|
||||||
}])
|
}])
|
||||||
|
|
||||||
.controller("PlansCtrl", ['$rootScope','Analytics',
|
.controller("PlansCtrl", ['$rootScope','Analytics',
|
||||||
|
|||||||
Reference in New Issue
Block a user