@adobe/helix-onedrive-support 9.1.21 → 9.1.23

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/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ ## [9.1.23](https://github.com/adobe/helix-onedrive-support/compare/v9.1.22...v9.1.23) (2023-03-23)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * clear mem cache and retry on auth fail ([#359](https://github.com/adobe/helix-onedrive-support/issues/359)) ([e43dd5d](https://github.com/adobe/helix-onedrive-support/commit/e43dd5d51d2e40946e92d4331831721979b5925c))
7
+
8
+ ## [9.1.22](https://github.com/adobe/helix-onedrive-support/compare/v9.1.21...v9.1.22) (2023-03-21)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * **deps:** update dependency @adobe/fetch to v4.0.6 ([af9e0e4](https://github.com/adobe/helix-onedrive-support/commit/af9e0e4c65d2fb19aea209d958f170de55244aa5))
14
+
1
15
  ## [9.1.21](https://github.com/adobe/helix-onedrive-support/compare/v9.1.20...v9.1.21) (2023-03-18)
2
16
 
3
17
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/helix-onedrive-support",
3
- "version": "9.1.21",
3
+ "version": "9.1.23",
4
4
  "description": "Helix OneDrive Support",
5
5
  "main": "src/index.js",
6
6
  "exports": {
@@ -27,7 +27,7 @@
27
27
  },
28
28
  "homepage": "https://github.com/adobe/helix-onedrive-support#readme",
29
29
  "dependencies": {
30
- "@adobe/fetch": "4.0.5",
30
+ "@adobe/fetch": "4.0.6",
31
31
  "@aws-sdk/client-s3": "3.294.0",
32
32
  "@azure/msal-node": "1.16.0",
33
33
  "jose": "4.13.1"
@@ -282,6 +282,18 @@ export class OneDriveAuth {
282
282
  } catch (e) {
283
283
  log.warn('Error while reacquiring token from cache', e);
284
284
  }
285
+ // try again with fresh mem cache
286
+ if (this.cachePlugin instanceof MemCachePlugin) {
287
+ this.cachePlugin.clear();
288
+ try {
289
+ return await app.acquireTokenSilent({
290
+ forceRefresh: true,
291
+ account: accounts[0],
292
+ });
293
+ } catch (e) {
294
+ log.warn('Error while reacquiring token from cache (forced)', e);
295
+ }
296
+ }
285
297
  }
286
298
  if (silentOnly) {
287
299
  return null;