only intercept with headers when api is at start

This commit is contained in:
Kyle Spearrin 2018-02-26 23:18:03 -05:00
parent 10f41bf288
commit aaa21daa29
2 changed files with 2 additions and 2 deletions

View File

@ -4,7 +4,7 @@ angular
.factory('apiInterceptor', function ($injector, $q, toastr, appSettings, utilsService) {
return {
request: function (config) {
if (config.url.indexOf(appSettings.apiUri + '/') > -1) {
if (config.url.indexOf(appSettings.apiUri + '/') === 0) {
config.headers['Device-Type'] = utilsService.getDeviceType();
}

View File

@ -20,7 +20,7 @@ angular
var refreshPromise;
jwtInterceptorProvider.tokenGetter = /*@ngInject*/ function (options, tokenService, authService) {
if (options.url.indexOf(appSettings.apiUri + '/') === -1) {
if (options.url.indexOf(appSettings.apiUri + '/') !== 0) {
return;
}