@evlop/commons 1.0.99 → 1.0.100
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/src/adapters/getUserToken/index.d.ts.map +1 -1
- package/dist/src/adapters/getUserToken/index.js +1 -0
- package/dist/src/adapters/getUserToken/index.js.map +1 -1
- package/dist/src/adapters/getUserToken/index.native.js +1 -1
- package/dist/src/adapters/getUserToken/index.native.js.map +1 -1
- package/dist/src/middlewares/restApiMiddleware.d.ts.map +1 -1
- package/dist/src/middlewares/restApiMiddleware.js +4 -5
- package/dist/src/middlewares/restApiMiddleware.js.map +1 -1
- package/package.json +1 -1
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/adapters/getUserToken/index.ts"],"names":[],"mappings":"AAAA,wBAA8B,YAAY,
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/adapters/getUserToken/index.ts"],"names":[],"mappings":"AAAA,wBAA8B,YAAY,oBAMzC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/adapters/getUserToken/index.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,SAA8B,YAAY;;QACtC,IAAG;YACC,OAAO,YAAY,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;SACxC;QAAC,OAAM,CAAC,EAAC;
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/adapters/getUserToken/index.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,SAA8B,YAAY;;QACtC,IAAG;YACC,OAAO,YAAY,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;SACxC;QAAC,OAAM,CAAC,EAAC;YACN,OAAO,IAAI,CAAC;SACf;IACL,CAAC;CAAA;AAND,+BAMC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.native.js","sourceRoot":"","sources":["../../../../src/adapters/getUserToken/index.native.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,8FAAqE;AAErE,SAA8B,YAAY;;QACtC,IAAG;YACC,MAAM,KAAK,GAAG,MAAM,uBAAY,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;YACxD,OAAO,KAAK,CAAC;SAChB;QAAC,OAAM,CAAC,EAAC;YACN,OAAO,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAC;SACtC;QACD,OAAO,
|
1
|
+
{"version":3,"file":"index.native.js","sourceRoot":"","sources":["../../../../src/adapters/getUserToken/index.native.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,8FAAqE;AAErE,SAA8B,YAAY;;QACtC,IAAG;YACC,MAAM,KAAK,GAAG,MAAM,uBAAY,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;YACxD,OAAO,KAAK,CAAC;SAChB;QAAC,OAAM,CAAC,EAAC;YACN,OAAO,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAC;SACtC;QACD,OAAO,IAAI,CAAC;IAChB,CAAC;CAAA;AARD,+BAQC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"restApiMiddleware.d.ts","sourceRoot":"","sources":["../../../src/middlewares/restApiMiddleware.tsx"],"names":[],"mappings":"AASA,eAAO,MAAM,iBAAiB,
|
1
|
+
{"version":3,"file":"restApiMiddleware.d.ts","sourceRoot":"","sources":["../../../src/middlewares/restApiMiddleware.tsx"],"names":[],"mappings":"AASA,eAAO,MAAM,iBAAiB,yDA4D7B,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
|
@@ -14,11 +14,10 @@ const apiBaseUrl = constants_1.API_BASE_URL || '/api/';
|
|
14
14
|
const restApiMiddleware = (store) => (dispatch) => (action) => {
|
15
15
|
if (action.isRestRequest) {
|
16
16
|
return getUserToken_1.default().then((token) => {
|
17
|
-
const requestOptions = {
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
};
|
17
|
+
const requestOptions = {};
|
18
|
+
if (token) {
|
19
|
+
lodash_1.set(requestOptions, ['headers', 'Authorization'], `Bearer ${token}`);
|
20
|
+
}
|
22
21
|
let endpoint = action.endpoint;
|
23
22
|
const isExternal = helpers_1.isExternalUrl(endpoint);
|
24
23
|
if (!isExternal) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"restApiMiddleware.js","sourceRoot":"","sources":["../../../src/middlewares/restApiMiddleware.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,wCAAyC;AACzC,wCAAwD;AACxD,4EAAoD;AACpD,4CAA0C;AAC1C,
|
1
|
+
{"version":3,"file":"restApiMiddleware.js","sourceRoot":"","sources":["../../../src/middlewares/restApiMiddleware.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,wCAAyC;AACzC,wCAAwD;AACxD,4EAAoD;AACpD,4CAA0C;AAC1C,mCAA2C;AAE3C,MAAM,UAAU,GAAG,wBAAY,IAAI,OAAO,CAAC;AAEpC,MAAM,iBAAiB,GAAG,CAAC,KAAK,EAAC,EAAE,CAAA,CAAC,QAAQ,EAAC,EAAE,CAAA,CAAC,MAAM,EAAC,EAAE;IAC5D,IAAG,MAAM,CAAC,aAAa,EAAC;QACpB,OAAO,sBAAY,EAAE,CAAC,IAAI,CAAC,CAAC,KAAa,EAAE,EAAE;YACzC,MAAM,cAAc,GAAG,EAAE,CAAC;YAC1B,IAAG,KAAK,EAAC;gBACL,YAAG,CAAC,cAAc,EAAE,CAAC,SAAS,EAAE,eAAe,CAAC,EAAE,UAAU,KAAK,EAAE,CAAC,CAAA;aACvE;YACD,IAAI,QAAQ,GAAU,MAAM,CAAC,QAAQ,CAAC;YACtC,MAAM,UAAU,GAAG,uBAAa,CAAC,QAAQ,CAAC,CAAC;YAC3C,IAAG,CAAC,UAAU,EAAC;gBACX,QAAQ,GAAG,QAAQ,CAAC,OAAO,CAAC,uBAAuB,EAAE,GAAG,UAAU,IAAI,CAAC,CAAA;aAC1E;YACD,IAAG,MAAM,CAAC,UAAU,EAAC;gBACjB,0BAA0B;gBAC1B,MAAM,EAAE,U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