Skip to content

Commit

Permalink
Update API Service to use new satellizer token - #202
Browse files Browse the repository at this point in the history
  • Loading branch information
jadjoubran committed Mar 23, 2016
1 parent e375e51 commit 6408848
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions angular/services/API.service.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export class APIService {
constructor(Restangular, ToastService, $localStorage) {
constructor(Restangular, ToastService, $window) {
'ngInject';
//content negotiation
var headers = {
Expand All @@ -19,8 +19,9 @@ export class APIService {
}
})
.addFullRequestInterceptor(function(element, operation, what, url, headers) {
if ($localStorage.jwt) {
headers.Authorization = 'Bearer ' + $localStorage.jwt;
var token = $window.localStorage.satellizer_token;
if (token) {
headers.Authorization = 'Bearer ' + token;
}
});
});
Expand Down

0 comments on commit 6408848

Please sign in to comment.