@reactionary/provider-commercetools 0.0.78 → 0.0.79
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/core/token-cache.js +4 -0
- package/package.json +2 -2
package/core/token-cache.js
CHANGED
|
@@ -4,9 +4,11 @@ class RequestContextTokenCache {
|
|
|
4
4
|
this.context = context;
|
|
5
5
|
}
|
|
6
6
|
async get(tokenCacheOptions) {
|
|
7
|
+
console.log("TokenCache get called with options:", tokenCacheOptions);
|
|
7
8
|
const session = CommercetoolsSessionSchema.parse(
|
|
8
9
|
this.context.session["PROVIDER_COMMERCETOOLS"] || {}
|
|
9
10
|
);
|
|
11
|
+
console.log("TokenCache get session:", session);
|
|
10
12
|
if (!session) {
|
|
11
13
|
return {
|
|
12
14
|
refreshToken: void 0,
|
|
@@ -21,6 +23,7 @@ class RequestContextTokenCache {
|
|
|
21
23
|
};
|
|
22
24
|
}
|
|
23
25
|
async set(cache, tokenCacheOptions) {
|
|
26
|
+
console.log("TokenCache set session:", this.context.session["PROVIDER_COMMERCETOOLS"], "with token:", cache);
|
|
24
27
|
const session = CommercetoolsSessionSchema.parse(
|
|
25
28
|
this.context.session["PROVIDER_COMMERCETOOLS"] || {}
|
|
26
29
|
);
|
|
@@ -28,6 +31,7 @@ class RequestContextTokenCache {
|
|
|
28
31
|
session.refreshToken = cache.refreshToken;
|
|
29
32
|
session.token = cache.token;
|
|
30
33
|
session.expirationTime = cache.expirationTime;
|
|
34
|
+
console.log("TokenCache updated session:", this.context.session["PROVIDER_COMMERCETOOLS"]);
|
|
31
35
|
}
|
|
32
36
|
}
|
|
33
37
|
export {
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reactionary/provider-commercetools",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.79",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"types": "src/index.d.ts",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@reactionary/core": "0.0.
|
|
7
|
+
"@reactionary/core": "0.0.79",
|
|
8
8
|
"debug": "^4.4.3",
|
|
9
9
|
"zod": "4.1.9",
|
|
10
10
|
"@commercetools/ts-client": "^4.2.1",
|