Use anonymous function as interceptor.
This commit is contained in:
parent
d6eb6781c6
commit
9a7d3938aa
@ -74,8 +74,10 @@ module.exports = angular.module('accountant.login', [
|
||||
};
|
||||
})
|
||||
|
||||
.factory('sessionInjector', function($storage) {
|
||||
var sessionInjector = {
|
||||
.config(function($httpProvider, $storageProvider) {
|
||||
// Define interceptors.
|
||||
$httpProvider.interceptors.push(function($storage) {
|
||||
return {
|
||||
request: function(config) {
|
||||
var access_token = $storage.session.get('access_token');
|
||||
|
||||
@ -87,15 +89,9 @@ module.exports = angular.module('accountant.login', [
|
||||
}
|
||||
|
||||
return config;
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
return sessionInjector;
|
||||
})
|
||||
|
||||
.config(function($httpProvider, $storageProvider) {
|
||||
// Define interceptors.
|
||||
$httpProvider.interceptors.push('sessionInjector');
|
||||
});
|
||||
|
||||
// Configure storage
|
||||
// Set global prefix for stored keys
|
||||
|
Loading…
Reference in New Issue
Block a user