diff --git a/CHANGELOG.md b/CHANGELOG.md index f38c26c59..941045aac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,11 @@ # Changelog -## 7.22.29 +## 7.22.30 + +- [8c98b27](https://github.com/AxaFrance/oidc-client/commit/8c98b2701e1118538455816ca458062cfc07d716) - fix(oidc): remove missing console.log (#1472) (release), 2024-10-01 by *Guillaume Chervet* + + +## v7.22.29 - [e297a7b](https://github.com/AxaFrance/oidc-client/commit/e297a7b5bd9d3eebb7cea443185039a7cb74d2f4) - fix(oidc): navigator locks null (#1466) (release), 2024-09-29 by *Guillaume Chervet* @@ -328,11 +333,3 @@ - [1676881](https://github.com/AxaFrance/oidc-client/commit/1676881f1db53cff6652ee7fe9658a437682231f) - feat(oidc): idToken can be null on a refresh (release) (#1271), 2024-01-29 by *Guillaume Chervet* -## v7.14.1 - -- [0fe53a6](https://github.com/AxaFrance/oidc-client/commit/0fe53a6b870c13c71330806a045896ea1e0a57e2) - fix(oidc): remove console.log (release), 2024-01-28 by *Guillaume Chervet* -- [b23d6a7](https://github.com/AxaFrance/oidc-client/commit/b23d6a7e1fc04ce43f489ac8977de9fe5affff73) - Merge branch 'main' of https://github.com/AxaFrance/oidc-client, 2024-01-28 by *Guillaume Chervet* -- [14ccbeb](https://github.com/AxaFrance/oidc-client/commit/14ccbeb83f1d7e790b496e571d424f615a39b43f) - fix(oidc): demo and remove console.log, 2024-01-28 by *Guillaume Chervet* -- [15eb259](https://github.com/AxaFrance/oidc-client/commit/15eb2592d9582cb43798a5d7fc988b3c349e5b43) - doc(oidc): Update README.md, 2024-01-26 by *Guillaume Chervet* - - diff --git a/examples/react-oidc-demo/package.json b/examples/react-oidc-demo/package.json index 1385c0cdc..54ad7d769 100644 --- a/examples/react-oidc-demo/package.json +++ b/examples/react-oidc-demo/package.json @@ -11,7 +11,8 @@ "url": "https://github.com/AxaGuilDEv/react-oidc.git" }, "scripts": { - "start": "vite", + "start": "pnpm prestart && pnpm vite", + "prestart": "node ./node_modules/@axa-fr/react-oidc/bin/copy-service-worker-files.mjs public", "build": "vite build", "serve": "vite preview", "clean": "rimraf dist", diff --git a/packages/oidc-client-service-worker/package.json b/packages/oidc-client-service-worker/package.json index dffbfdea0..603239497 100644 --- a/packages/oidc-client-service-worker/package.json +++ b/packages/oidc-client-service-worker/package.json @@ -1,6 +1,6 @@ { "name": "@axa-fr/oidc-client-service-worker", - "version": "7.22.29", + "version": "7.22.30", "type": "module", "private": false, "main": "dist/OidcServiceWorker.js", diff --git a/packages/oidc-client-service-worker/src/version.ts b/packages/oidc-client-service-worker/src/version.ts index 06103d5ee..b26a6f71d 100644 --- a/packages/oidc-client-service-worker/src/version.ts +++ b/packages/oidc-client-service-worker/src/version.ts @@ -1 +1 @@ -export default '7.22.29'; +export default '7.22.30'; diff --git a/packages/oidc-client/package.json b/packages/oidc-client/package.json index c5e760da0..6ca3428a5 100644 --- a/packages/oidc-client/package.json +++ b/packages/oidc-client/package.json @@ -1,6 +1,6 @@ { "name": "@axa-fr/oidc-client", - "version": "7.22.29", + "version": "7.22.30", "private": false, "type": "module", "main": "./dist/index.umd.cjs", diff --git a/packages/oidc-client/src/initWorker.ts b/packages/oidc-client/src/initWorker.ts index 3ebbf95fe..56443a7f7 100644 --- a/packages/oidc-client/src/initWorker.ts +++ b/packages/oidc-client/src/initWorker.ts @@ -113,6 +113,11 @@ export const initWorkerAsync = async ( registration = await configuration.service_worker_register(serviceWorkerRelativeUrl); } else { registration = await navigator.serviceWorker.register(serviceWorkerRelativeUrl); + + if (registration.active && registration.waiting) { + console.log('Detected new service worker waiting, unregistering and reloading'); + await configuration.service_worker_update_require_callback?.(registration, stopKeepAlive); + } } try { @@ -151,7 +156,7 @@ export const initWorkerAsync = async ( console.warn( `Service worker ${serviceWorkerVersion} version mismatch with js client version ${codeVersion}, unregistering and reloading`, ); - await oidcConfiguration.service_worker_update_require_callback(registration, stopKeepAlive); + await oidcConfiguration.service_worker_update_require_callback?.(registration, stopKeepAlive); } // @ts-ignore diff --git a/packages/oidc-client/src/version.ts b/packages/oidc-client/src/version.ts index 06103d5ee..b26a6f71d 100644 --- a/packages/oidc-client/src/version.ts +++ b/packages/oidc-client/src/version.ts @@ -1 +1 @@ -export default '7.22.29'; +export default '7.22.30'; diff --git a/packages/react-oidc/package.json b/packages/react-oidc/package.json index eeea9449f..951cd6cbc 100644 --- a/packages/react-oidc/package.json +++ b/packages/react-oidc/package.json @@ -1,6 +1,6 @@ { "name": "@axa-fr/react-oidc", - "version": "7.22.29", + "version": "7.22.30", "private": false, "type": "module", "main": "./dist/index.umd.cjs",