@shoutem/api-sdk
Advanced tools
Comparing version 1.1.8-beta8 to 1.1.8-beta9
@@ -60,4 +60,4 @@ 'use strict'; | ||
// eslint-disable-next-line max-len | ||
var additionalEndpoints = _lodash2.default.join(additionalApiEndpoints, '|'); | ||
var apiSubdomainRegex = new RegExp('^([.a-z0-9]*?).*(localhost|' + baseApi + '|' + additionalEndpoints + ')', 'g'); | ||
var additionalEndpoints = '|' + _lodash2.default.join(additionalApiEndpoints, '|'); | ||
var apiSubdomainRegex = new RegExp('^([.a-z0-9]*?).*(localhost|' + baseApi + additionalEndpoints + ')', 'g'); | ||
return function (request) { | ||
@@ -67,9 +67,4 @@ // add auth headers only if we're accessing known API endpoints | ||
var requestHostname = requestUri.hostname(); | ||
console.log(request.url, requestHostname.match(apiSubdomainRegex)); | ||
console.log(authTokenEndpoint); | ||
console.log(authSessionEndpoint); | ||
var authRequired = requestHostname.match(apiSubdomainRegex); | ||
var returnValue = authRequired && request.url !== authTokenEndpoint && request.url !== authSessionEndpoint; | ||
console.log(authRequired, returnValue); | ||
return returnValue; | ||
@@ -103,3 +98,2 @@ }; | ||
function initializeFetchTokenInterceptor(config) { | ||
console.log('fti config2', config); | ||
var refreshToken = config.auth.token; | ||
@@ -129,4 +123,2 @@ var _config$url = config.url, | ||
function extendShouldIntercept(config) { | ||
console.log('fti config3', config); | ||
var refreshToken = config.auth.token; | ||
var _config$url2 = config.url, | ||
@@ -137,6 +129,7 @@ baseApi = _config$url2.baseApi, | ||
var configiruation = { shouldIntercept: shouldIntercept(baseApi, additionalApiEndpoints) }; | ||
var configuration = { | ||
shouldIntercept: shouldIntercept(baseApi, additionalApiEndpoints) | ||
}; | ||
fetchTokenIntercept.configure(configiruation); | ||
fetchTokenIntercept.authorize(refreshToken); | ||
fetchTokenIntercept.configure(configuration); | ||
} |
{ | ||
"name": "@shoutem/api-sdk", | ||
"version": "1.1.8-beta8", | ||
"version": "1.1.8-beta9", | ||
"description": "Javascript SDK for Shoutem API using fetch", | ||
@@ -47,2 +47,2 @@ "main": "build/lib/index.js", | ||
} | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
31248
681