mirror of
https://github.com/fergalmoran/dss.web.git
synced 2026-02-15 12:34:17 +00:00
16 lines
450 B
JavaScript
16 lines
450 B
JavaScript
'use strict';
|
|
angular.module('dssWebApp')
|
|
.factory('AuthInterceptor', function ($q, jwtHelper, Session) {
|
|
return {
|
|
request: addToken
|
|
};
|
|
function addToken(config) {
|
|
var token = Session.getToken();
|
|
if (token) {
|
|
config.headers = config.headers || {};
|
|
config.headers.Authorization = 'JWT ' + token;
|
|
}
|
|
return config;
|
|
}
|
|
});
|