From ddc37868dae1b3c1642651aa4b919e391bed63bb Mon Sep 17 00:00:00 2001
From: GitHub
Date: Tue, 16 Jul 2024 19:35:48 +0000
Subject: [PATCH 01/12] [skip ci] Update to version 7.22.18 in package.json
---
packages/oidc-client-service-worker/package.json | 2 +-
packages/oidc-client-service-worker/src/version.ts | 2 +-
packages/oidc-client/package.json | 2 +-
packages/oidc-client/src/version.ts | 2 +-
packages/react-oidc/package.json | 2 +-
5 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/packages/oidc-client-service-worker/package.json b/packages/oidc-client-service-worker/package.json
index d31aad534..82f6a762d 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.17",
+ "version": "7.22.18",
"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 34018eb9a..85f099e5b 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.17';
+export default '7.22.18';
diff --git a/packages/oidc-client/package.json b/packages/oidc-client/package.json
index 82bd15624..fdc2866a0 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.17",
+ "version": "7.22.18",
"private": false,
"type": "module",
"main": "./dist/index.umd.cjs",
diff --git a/packages/oidc-client/src/version.ts b/packages/oidc-client/src/version.ts
index 34018eb9a..85f099e5b 100644
--- a/packages/oidc-client/src/version.ts
+++ b/packages/oidc-client/src/version.ts
@@ -1 +1 @@
-export default '7.22.17';
+export default '7.22.18';
diff --git a/packages/react-oidc/package.json b/packages/react-oidc/package.json
index 4b3593fd0..d72d01592 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.17",
+ "version": "7.22.18",
"private": false,
"type": "module",
"main": "./dist/index.umd.cjs",
From 4ca142efe9d32cc0900cbb618f2106df8922b1bb Mon Sep 17 00:00:00 2001
From: GitHub
Date: Tue, 16 Jul 2024 19:35:50 +0000
Subject: [PATCH 02/12] [skip ci] Generate changelog to version 7.22.18
---
CHANGELOG.md | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 373e36d4e..b887dbf34 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,6 +1,11 @@
# Changelog
-## 7.22.17
+## 7.22.18
+
+- [5ee0cc8](https://github.com/AxaFrance/oidc-client/commit/5ee0cc8f6d823056da221ad081c3821ba9fac343) - fix(oidc): separate state, nonce and codeVerifier for each tab (release) (#1402), 2024-07-16 by *Miya*
+
+
+## v7.22.17
- [b099078](https://github.com/AxaFrance/oidc-client/commit/b099078f9d4b61dffd03034f511a4f32e80977a8) - fix(oidc): clenup client internal promises when requests are finished (release) (#1417), 2024-07-15 by *wermanoid*
- [01f0714](https://github.com/AxaFrance/oidc-client/commit/01f0714241e6442e6b58fcba8b86804ed75cec09) - tests(domain): Be more explicit about intent of test, is to not throw, not return undefined. (#1413), 2024-07-15 by *Jason Finch*
@@ -317,8 +322,3 @@
- [64a8df3](https://github.com/AxaFrance/oidc-client/commit/64a8df3281f95159a60e5f9ec61db315a8d20c7d) - fix(oidc-client): make locks work only ifAvailable (#1237)(alpha), 2023-12-09 by *abhilashlr*
-## v7.13.6
-
-- [da77bb9](https://github.com/AxaFrance/oidc-client/commit/da77bb912b61e5aad93c53e84ce4fbea2a503fb2) - build(npm): bump typescript from 5.1.6 to 5.3.3 (#1232), 2023-12-07 by *dependabot[bot]*
-
-
From cd2f57edb99e04495b9884723cd05277a45aad43 Mon Sep 17 00:00:00 2001
From: Guillaume Chervet
Date: Tue, 16 Jul 2024 21:38:55 +0200
Subject: [PATCH 03/12] fix(demo): Update configurations.ts
---
examples/react-oidc-demo/src/configurations.ts | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/examples/react-oidc-demo/src/configurations.ts b/examples/react-oidc-demo/src/configurations.ts
index 4447f3a8b..16efca83f 100644
--- a/examples/react-oidc-demo/src/configurations.ts
+++ b/examples/react-oidc-demo/src/configurations.ts
@@ -9,7 +9,7 @@ export const configurationIdentityServer = {
authority: 'https://demo.duendesoftware.com',
// authority_time_cache_wellknowurl_in_second: 60* 60,
refresh_time_before_tokens_expiration_in_second: 40,
- // service_worker_relative_url: '/OidcServiceWorker.js',
+ service_worker_relative_url: '/OidcServiceWorker.js',
service_worker_only: false,
// storage: localStorage,
// silent_login_timeout: 3333000
From bb7bc929f7a1bc4f1d210216d89fad881056990f Mon Sep 17 00:00:00 2001
From: Jason Finch
Date: Fri, 12 Jul 2024 23:01:14 +1000
Subject: [PATCH 04/12] fix (lint): Fix all lint errors reporting by eslint.
---
eslint.config.mjs | 23 ++++---
examples/oidc-client-demo/src/index.tsx | 4 +-
examples/react-oidc-demo/src/App.tsx | 2 +-
examples/react-oidc-demo/src/FetchUser.tsx | 2 +-
examples/react-oidc-demo/src/Home.tsx | 4 +-
examples/react-oidc-demo/src/MultiAuth.tsx | 2 +-
examples/react-oidc-demo/src/Profile.tsx | 2 +-
.../react-oidc-demo/src/configurations.ts | 4 +-
.../src/override/SessionLost.component.tsx | 2 +-
.../src/OidcServiceWorker.ts | 14 ++--
.../src/OidcTrustedDomains.js | 2 +-
.../src/__tests__/oidcConfig.spec.ts | 65 ++++++++++---------
.../oidc-client-service-worker/src/dpop.ts | 10 +--
.../oidc-client-service-worker/src/jwt.ts | 27 ++++----
.../oidc-client-service-worker/src/types.ts | 18 ++---
.../src/utils/__tests__/codeVerifier.spec.ts | 2 +-
.../src/utils/__tests__/tokens.spec.ts | 6 +-
.../src/utils/codeVerifier.ts | 2 +-
.../src/utils/tokens.ts | 6 +-
.../bin/copy-service-worker-files.mjs | 10 +--
packages/oidc-client/src/checkSession.ts | 6 +-
packages/oidc-client/src/fetch.ts | 5 +-
packages/oidc-client/src/index.ts | 19 +++---
packages/oidc-client/src/initSession.ts | 4 +-
packages/oidc-client/src/initWorker.ts | 10 +--
packages/oidc-client/src/initWorkerOption.ts | 2 +-
packages/oidc-client/src/jwt.ts | 27 ++++----
packages/oidc-client/src/keepSession.ts | 10 +--
packages/oidc-client/src/login.ts | 8 +--
packages/oidc-client/src/logout.spec.ts | 2 +-
packages/oidc-client/src/logout.ts | 20 +++---
packages/oidc-client/src/oidc.ts | 30 ++++-----
packages/oidc-client/src/oidcClient.ts | 4 +-
packages/oidc-client/src/parseTokens.spec.ts | 39 +++++------
packages/oidc-client/src/parseTokens.ts | 4 +-
packages/oidc-client/src/renewTokens.ts | 19 +++---
packages/oidc-client/src/requests.ts | 6 +-
packages/oidc-client/src/silentLogin.ts | 2 +-
packages/oidc-client/src/types.ts | 12 ++--
packages/oidc-client/src/user.ts | 2 +-
packages/oidc-client/tests/setup.js | 8 +--
.../bin/copy-service-worker-files.mjs | 10 +--
packages/react-oidc/src/OidcProvider.tsx | 10 +--
packages/react-oidc/src/OidcSecure.tsx | 2 +-
packages/react-oidc/src/ReactOidc.tsx | 14 ++--
packages/react-oidc/src/User.ts | 2 +-
.../react-oidc/src/core/routes/OidcRoutes.tsx | 1 -
packages/react-oidc/src/index.ts | 7 +-
packages/react-oidc/vite.config.ts | 2 +-
49 files changed, 245 insertions(+), 249 deletions(-)
diff --git a/eslint.config.mjs b/eslint.config.mjs
index ccf603f77..e86569eb0 100644
--- a/eslint.config.mjs
+++ b/eslint.config.mjs
@@ -1,21 +1,22 @@
-import { fixupConfigRules, fixupPluginRules } from "@eslint/compat";
-import typescriptEslint from "@typescript-eslint/eslint-plugin";
-import simpleImportSort from "eslint-plugin-simple-import-sort";
-import testingLibrary from "eslint-plugin-testing-library";
-import react from "eslint-plugin-react";
-import prettier from "eslint-plugin-prettier";
-import tsParser from "@typescript-eslint/parser";
import path from "node:path";
import { fileURLToPath } from "node:url";
-import js from "@eslint/js";
+
+import { fixupConfigRules, fixupPluginRules } from "@eslint/compat";
import { FlatCompat } from "@eslint/eslintrc";
+import js from "@eslint/js";
+import typescriptEslint from "@typescript-eslint/eslint-plugin";
+import tsParser from "@typescript-eslint/parser";
+import prettier from "eslint-plugin-prettier";
+import react from "eslint-plugin-react";
+import simpleImportSort from "eslint-plugin-simple-import-sort";
+//import testingLibrary from "eslint-plugin-testing-library";
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
- allConfig: js.configs.all
+ allConfig: js.configs.all,
});
export default [{
@@ -74,6 +75,10 @@ export default [{
},
settings: {
+ env: {
+ browser: true,
+ node: true,
+ },
react: {
version: "18",
},
diff --git a/examples/oidc-client-demo/src/index.tsx b/examples/oidc-client-demo/src/index.tsx
index b81c4f853..50f237b0a 100644
--- a/examples/oidc-client-demo/src/index.tsx
+++ b/examples/oidc-client-demo/src/index.tsx
@@ -105,9 +105,9 @@ const display = (element:any) => {
// @ts-ignore
window.document.getElementById('buttonxsshack').addEventListener('click',()=> {
// @ts-ignore
- eval(document.getElementById('xsshack').value)
+ eval(document.getElementById('xsshack').value);
});
-}
+};
// @ts-ignore
export const execute = () => {
diff --git a/examples/react-oidc-demo/src/App.tsx b/examples/react-oidc-demo/src/App.tsx
index f80c9250f..fe54fb012 100644
--- a/examples/react-oidc-demo/src/App.tsx
+++ b/examples/react-oidc-demo/src/App.tsx
@@ -28,7 +28,7 @@ function reducer(state, action) {
function App() {
- // eslint-disable-next-line @typescript-eslint/naming-convention
+
const [show, setShow] = React.useState(false);
const [events, dispatch] = useReducer(reducer, []);
diff --git a/examples/react-oidc-demo/src/FetchUser.tsx b/examples/react-oidc-demo/src/FetchUser.tsx
index e9c5206fb..ea86a2a98 100644
--- a/examples/react-oidc-demo/src/FetchUser.tsx
+++ b/examples/react-oidc-demo/src/FetchUser.tsx
@@ -23,7 +23,7 @@ const DisplayUserInfo = ({ fetch }) => {
return () => {
isMounted = false;
};
- // eslint-disable-next-line react-hooks/exhaustive-deps
+
}, []);
if (isLoading) {
diff --git a/examples/react-oidc-demo/src/Home.tsx b/examples/react-oidc-demo/src/Home.tsx
index b8b43dd5b..54398b3de 100644
--- a/examples/react-oidc-demo/src/Home.tsx
+++ b/examples/react-oidc-demo/src/Home.tsx
@@ -8,12 +8,12 @@ import {useNavigate} from "react-router-dom";
const html = 'Foo';
iframe.srcdoc = html;
document.body.appendChild(iframe);
-}
+};
export const Home = () => {
const { login, logout, renewTokens, isAuthenticated } = useOidc();
const{ oidcUser, oidcUserLoadingState } = useOidcUser();
- console.log(oidcUser, oidcUserLoadingState)
+ console.log(oidcUser, oidcUserLoadingState);
const navigate = useNavigate();
const navigateProfile = () => {
diff --git a/examples/react-oidc-demo/src/MultiAuth.tsx b/examples/react-oidc-demo/src/MultiAuth.tsx
index c10070f44..94546178e 100644
--- a/examples/react-oidc-demo/src/MultiAuth.tsx
+++ b/examples/react-oidc-demo/src/MultiAuth.tsx
@@ -2,13 +2,13 @@ import { Fetch, OidcProvider, useOidc, useOidcAccessToken, useOidcIdToken } from
import React, { useReducer, useState } from 'react';
import { configurationGoogle, configurationIdentityServer, configurationIdentityServerWithHash } from './configurations';
+import {FetchUserHook} from "./FetchUser";
import AuthenticatingError from './override/AuthenticateError.component';
import Authenticating from './override/Authenticating.component';
import { CallBackSuccess } from './override/Callback.component';
import Loading from './override/Loading.component';
import ServiceWorkerNotSupported from './override/ServiceWorkerNotSupported.component';
import SessionLost from './override/SessionLost.component';
-import {FetchUserHook} from "./FetchUser";
const fetchWithLogs = (fetch: Fetch) => async (...params: Parameters) => {
const [url, options, ...rest] = params;
diff --git a/examples/react-oidc-demo/src/Profile.tsx b/examples/react-oidc-demo/src/Profile.tsx
index 73a1028eb..260030839 100644
--- a/examples/react-oidc-demo/src/Profile.tsx
+++ b/examples/react-oidc-demo/src/Profile.tsx
@@ -5,7 +5,7 @@ import {
useOidc,
useOidcAccessToken,
useOidcIdToken,
- useOidcUser
+ useOidcUser,
} from '@axa-fr/react-oidc';
import React from 'react';
diff --git a/examples/react-oidc-demo/src/configurations.ts b/examples/react-oidc-demo/src/configurations.ts
index 16efca83f..1a8f095d3 100644
--- a/examples/react-oidc-demo/src/configurations.ts
+++ b/examples/react-oidc-demo/src/configurations.ts
@@ -1,4 +1,4 @@
-import { TokenRenewMode, TokenAutomaticRenewMode } from '@axa-fr/react-oidc';
+import { TokenAutomaticRenewMode,TokenRenewMode } from '@axa-fr/react-oidc';
export const configurationIdentityServer = {
client_id: 'interactive.public.short',
@@ -18,7 +18,7 @@ export const configurationIdentityServer = {
token_renew_mode: TokenRenewMode.access_token_invalid,
token_automatic_renew_mode: TokenAutomaticRenewMode.AutomaticOnlyWhenFetchExecuted,
demonstrating_proof_of_possession: false,
- preload_user_info: true
+ preload_user_info: true,
};
export const configurationIdentityServer1 = {
diff --git a/examples/react-oidc-demo/src/override/SessionLost.component.tsx b/examples/react-oidc-demo/src/override/SessionLost.component.tsx
index 080e599dc..19d137da5 100644
--- a/examples/react-oidc-demo/src/override/SessionLost.component.tsx
+++ b/examples/react-oidc-demo/src/override/SessionLost.component.tsx
@@ -1,8 +1,8 @@
import { useOidc } from '@axa-fr/react-oidc';
import { ComponentType } from 'react';
+import {useNavigate} from "react-router-dom";
import { style } from './style.js';
-import {useNavigate} from "react-router-dom";
export const SessionLost: ComponentType = ({ configurationName }) => {
const { login } = useOidc(configurationName);
diff --git a/packages/oidc-client-service-worker/src/OidcServiceWorker.ts b/packages/oidc-client-service-worker/src/OidcServiceWorker.ts
index abca232f5..4cc166946 100644
--- a/packages/oidc-client-service-worker/src/OidcServiceWorker.ts
+++ b/packages/oidc-client-service-worker/src/OidcServiceWorker.ts
@@ -1,4 +1,8 @@
import { acceptAnyDomainToken, scriptFilename, TOKEN } from './constants';
+import {base64urlOfHashOfASCIIEncodingAsync} from "./crypto";
+import {getDpopConfiguration, getDpopOnlyWhenDpopHeaderPresent} from "./dpop";
+import {generateJwkAsync, generateJwtDemonstratingProofOfPossessionAsync} from "./jwt";
+import { getCurrentDatabasesTokenEndpoint } from './oidcConfig';
import {
Database,
MessageEventData,
@@ -17,10 +21,6 @@ import {
import {extractConfigurationNameFromCodeVerifier, replaceCodeVerifier} from './utils/codeVerifier';
import { normalizeUrl } from './utils/normalizeUrl';
import version from './version';
-import {generateJwkAsync, generateJwtDemonstratingProofOfPossessionAsync} from "./jwt";
-import {getDpopConfiguration, getDpopOnlyWhenDpopHeaderPresent} from "./dpop";
-import {base64urlOfHashOfASCIIEncodingAsync} from "./crypto";
-import { getCurrentDatabasesTokenEndpoint } from './oidcConfig';
// @ts-ignore
if (typeof trustedTypes !== 'undefined' && typeof trustedTypes.createPolicy == 'function') {
@@ -132,7 +132,7 @@ const handleFetch = async (event: FetchEvent) => {
} else {
const authorization = originalRequest.headers.get('authorization');
- let authenticationMode = "Bearer"
+ let authenticationMode = "Bearer";
if (authorization ) {
authenticationMode = authorization.split(" ")[0];
}
@@ -184,7 +184,7 @@ const handleFetch = async (event: FetchEvent) => {
const currentDbTabs = Object.keys(currentDb.state);
if (currentDb?.tokens != null) {
- const claimsExtras = {ath: await base64urlOfHashOfASCIIEncodingAsync(currentDb.tokens.access_token),};
+ const claimsExtras = {ath: await base64urlOfHashOfASCIIEncodingAsync(currentDb.tokens.access_token)};
headers = await generateDpopAsync(originalRequest, currentDb, url, claimsExtras);
for(let j = 0; j < currentDbTabs.length; j++) {
@@ -401,7 +401,7 @@ const handleMessage = async (event: ExtendableMessageEvent) => {
const demonstratingProofOfPossessionConfiguration = getDpopConfiguration(trustedDomains[configurationName]);
if(demonstratingProofOfPossessionConfiguration != null){
if(currentDatabase.oidcConfiguration.demonstrating_proof_of_possession){
- console.warn("In service worker, demonstrating_proof_of_possession must be configured from trustedDomains file")
+ console.warn("In service worker, demonstrating_proof_of_possession must be configured from trustedDomains file");
}
currentDatabase.demonstratingProofOfPossessionConfiguration = demonstratingProofOfPossessionConfiguration;
currentDatabase.demonstratingProofOfPossessionJwkJson = await generateJwkAsync(self)(demonstratingProofOfPossessionConfiguration.generateKeyAlgorithm);
diff --git a/packages/oidc-client-service-worker/src/OidcTrustedDomains.js b/packages/oidc-client-service-worker/src/OidcTrustedDomains.js
index 9a31a5bbd..cc23305c5 100644
--- a/packages/oidc-client-service-worker/src/OidcTrustedDomains.js
+++ b/packages/oidc-client-service-worker/src/OidcTrustedDomains.js
@@ -3,7 +3,7 @@
// then all subroute like https://www.myapi.com/useers/1 will be authorized to send access_token to.
// Domains used by OIDC server must be also declared here
-// eslint-disable-next-line @typescript-eslint/no-unused-vars
+
const trustedDomains = {
default: ['https://demo.duendesoftware.com', 'https://kdhttps.auth0.com'],
config_classic: ['https://demo.duendesoftware.com'],
diff --git a/packages/oidc-client-service-worker/src/__tests__/oidcConfig.spec.ts b/packages/oidc-client-service-worker/src/__tests__/oidcConfig.spec.ts
index 6480daaf0..5ebd29eb3 100644
--- a/packages/oidc-client-service-worker/src/__tests__/oidcConfig.spec.ts
+++ b/packages/oidc-client-service-worker/src/__tests__/oidcConfig.spec.ts
@@ -1,6 +1,7 @@
-import { describe, expect, it } from 'vitest'
-import { getCurrentDatabasesTokenEndpoint } from '../oidcConfig'
-import { Database } from '../types'
+import { describe, expect, it } from 'vitest';
+
+import { getCurrentDatabasesTokenEndpoint } from '../oidcConfig';
+import { Database } from '../types';
const oidcConfigDefaults = {
demonstratingProofOfPossessionConfiguration: null,
@@ -16,16 +17,16 @@ const oidcConfigDefaults = {
demonstratingProofOfPossessionNonce: null,
demonstratingProofOfPossessionJwkJson: null,
demonstratingProofOfPossessionOnlyWhenDpopHeaderPresent: false,
- allowMultiTabLogin: true
-}
+ allowMultiTabLogin: true,
+};
const oidcServerConfigDefault = {
revocationEndpoint: '',
tokenEndpoint: '',
issuer: '',
userInfoEndpoint: '',
- authorizationEndpoint: ''
-}
+ authorizationEndpoint: '',
+};
describe('getCurrentDatabasesTokenEndpoint', () => {
it('should return configs with matching token endpoint', () => {
@@ -51,14 +52,14 @@ describe('getCurrentDatabasesTokenEndpoint', () => {
revocationEndpoint: 'https://example.net/revoke',
},
},
- }
+ };
- const url = 'https://example.com/token'
- const result = getCurrentDatabasesTokenEndpoint(database, url)
+ const url = 'https://example.com/token';
+ const result = getCurrentDatabasesTokenEndpoint(database, url);
- expect(result).toHaveLength(1)
- expect(result[0]).toBe(database.config1)
- })
+ expect(result).toHaveLength(1);
+ expect(result[0]).toBe(database.config1);
+ });
it('should return configs with matching revocation endpoint', () => {
const database = {
@@ -83,14 +84,14 @@ describe('getCurrentDatabasesTokenEndpoint', () => {
tokenEndpoint: 'https://example.net/token',
},
},
- }
+ };
- const url = 'https://example.com/revoke'
- const result = getCurrentDatabasesTokenEndpoint(database, url)
+ const url = 'https://example.com/revoke';
+ const result = getCurrentDatabasesTokenEndpoint(database, url);
- expect(result).toHaveLength(1)
- expect(result[0]).toBe(database.config1)
- })
+ expect(result).toHaveLength(1);
+ expect(result[0]).toBe(database.config1);
+ });
it('should return multiple matching configs', () => {
const database = {
@@ -117,15 +118,15 @@ describe('getCurrentDatabasesTokenEndpoint', () => {
revocationEndpoint: 'https://example.com/revoke',
},
},
- }
+ };
- const url = 'https://example.com/token'
- const result = getCurrentDatabasesTokenEndpoint(database, url)
+ const url = 'https://example.com/token';
+ const result = getCurrentDatabasesTokenEndpoint(database, url);
- expect(result).toHaveLength(2)
- expect(result).toContain(database.config1)
- expect(result).toContain(database.config3)
- })
+ expect(result).toHaveLength(2);
+ expect(result).toContain(database.config1);
+ expect(result).toContain(database.config3);
+ });
it('should return empty array for no matching configs', () => {
const database = {
@@ -143,11 +144,11 @@ describe('getCurrentDatabasesTokenEndpoint', () => {
revocationEndpoint: 'https://example.org/revoke',
},
},
- }
+ };
- const url = 'https://example.net/other'
- const result = getCurrentDatabasesTokenEndpoint(database, url)
+ const url = 'https://example.net/other';
+ const result = getCurrentDatabasesTokenEndpoint(database, url);
- expect(result).toHaveLength(0)
- })
-})
+ expect(result).toHaveLength(0);
+ });
+});
diff --git a/packages/oidc-client-service-worker/src/dpop.ts b/packages/oidc-client-service-worker/src/dpop.ts
index 921c9f9ad..ebebc6a05 100644
--- a/packages/oidc-client-service-worker/src/dpop.ts
+++ b/packages/oidc-client-service-worker/src/dpop.ts
@@ -1,12 +1,12 @@
-import {Domain, DomainDetails} from "./types.js";
-import {defaultDemonstratingProofOfPossessionConfiguration} from "./jwt";
+import {defaultDemonstratingProofOfPossessionConfiguration} from "./jwt";
+import {Domain, DomainDetails} from "./types.js";
const isDpop= (trustedDomain: Domain[] | DomainDetails) : boolean => {
if (Array.isArray(trustedDomain)) {
return false;
}
return trustedDomain.demonstratingProofOfPossession ?? false;
-}
+};
export const getDpopConfiguration = (trustedDomain: Domain[] | DomainDetails) => {
@@ -19,7 +19,7 @@ export const getDpopConfiguration = (trustedDomain: Domain[] | DomainDetails) =>
}
return trustedDomain.demonstratingProofOfPossessionConfiguration ?? defaultDemonstratingProofOfPossessionConfiguration;
-}
+};
export const getDpopOnlyWhenDpopHeaderPresent = (trustedDomain: Domain[] | DomainDetails) => {
@@ -32,4 +32,4 @@ export const getDpopOnlyWhenDpopHeaderPresent = (trustedDomain: Domain[] | Domai
}
return trustedDomain.demonstratingProofOfPossessionOnlyWhenDpopHeaderPresent ?? true;
-}
\ No newline at end of file
+};
\ No newline at end of file
diff --git a/packages/oidc-client-service-worker/src/jwt.ts b/packages/oidc-client-service-worker/src/jwt.ts
index ef7665f19..43c356591 100644
--- a/packages/oidc-client-service-worker/src/jwt.ts
+++ b/packages/oidc-client-service-worker/src/jwt.ts
@@ -47,7 +47,7 @@ export const uint8ToUrlBase64 =(uint8: Uint8Array) => {
bin += String.fromCharCode(code);
});
return binToUrlBase64(bin);
-}
+};
// UCS-2 String to URL-Safe Base64
//
@@ -61,16 +61,16 @@ export const defaultDemonstratingProofOfPossessionConfiguration: DemonstratingPr
importKeyAlgorithm: {
name: 'ECDSA',
namedCurve: 'P-256',
- hash: {name: 'ES256'}
+ hash: {name: 'ES256'},
},
signAlgorithm: {name: 'ECDSA', hash: {name: 'SHA-256'}},
generateKeyAlgorithm: {
name: 'ECDSA',
- namedCurve: 'P-256'
+ namedCurve: 'P-256',
},
digestAlgorithm: { name: 'SHA-256' },
- jwtHeaderAlgorithm : 'ES256'
-}
+ jwtHeaderAlgorithm : 'ES256',
+};
// @ts-ignore
@@ -101,7 +101,7 @@ const sign = (w:any) => async (jwk, headers, claims, demonstratingProofOfPossess
protected: strToUrlBase64(JSON.stringify(headers)),
// @ts-ignore
// JWT "claims" are really a JSON-defined JWS "payload"
- payload: strToUrlBase64(JSON.stringify(claims))
+ payload: strToUrlBase64(JSON.stringify(claims)),
};
// To import as EC (ECDSA, P-256, SHA-256, ES256)
@@ -134,8 +134,7 @@ const sign = (w:any) => async (jwk, headers, claims, demonstratingProofOfPossess
return `${jws.protected}.${jws.payload}.${jws.signature}`;
};
-export var JWT = {sign};
-
+export const JWT = {sign};
// @ts-ignore
const generate = (w:any) => async (generateKeyAlgorithm: RsaHashedKeyGenParams | EcKeyGenParams) => {
@@ -162,7 +161,7 @@ const neuter = jwk => {
const EC = {
generate,
- neuter
+ neuter,
};
// @ts-ignore
const thumbprint = (w:any) => async (jwk, digestAlgorithm: AlgorithmIdentifier) => {
@@ -187,9 +186,9 @@ const thumbprint = (w:any) => async (jwk, digestAlgorithm: AlgorithmIdentifier)
// but we're only dealing with P-256
const hash = await w.crypto.subtle.digest(digestAlgorithm, strToUint8(sortedPub));
return uint8ToUrlBase64(new Uint8Array(hash));
-}
+};
-export var JWK = {thumbprint};
+export const JWK = {thumbprint};
export const generateJwkAsync = (w:any) => async (generateKeyAlgorithm: RsaHashedKeyGenParams | EcKeyGenParams) => {
// @ts-ignore
@@ -198,7 +197,7 @@ export const generateJwkAsync = (w:any) => async (generateKeyAlgorithm: RsaHashe
// @ts-ignore
// console.info('Public Key:', JSON.stringify(EC.neuter(jwk)));
return jwk;
-}
+};
export const generateJwtDemonstratingProofOfPossessionAsync = (w:any) => (demonstratingProofOfPossessionConfiguration: DemonstratingProofOfPossessionConfiguration) => async (jwk:any, method = 'POST', url: string, extrasClaims={}) => {
@@ -213,10 +212,10 @@ export const generateJwtDemonstratingProofOfPossessionAsync = (w:any) => (demons
// @ts-ignore
const kid = await JWK.thumbprint(w)(jwk, demonstratingProofOfPossessionConfiguration.digestAlgorithm);
// @ts-ignore
- const jwt = await JWT.sign(w)(jwk, { kid: kid }, claims, demonstratingProofOfPossessionConfiguration)
+ const jwt = await JWT.sign(w)(jwk, { kid: kid }, claims, demonstratingProofOfPossessionConfiguration);
// console.info('JWT:', jwt);
return jwt;
-}
+};
const guid = () => {
// RFC4122: The version 4 UUID is meant for generating UUIDs from truly-random or
diff --git a/packages/oidc-client-service-worker/src/types.ts b/packages/oidc-client-service-worker/src/types.ts
index 0b755f467..319d34113 100644
--- a/packages/oidc-client-service-worker/src/types.ts
+++ b/packages/oidc-client-service-worker/src/types.ts
@@ -3,8 +3,8 @@ export type DomainDetails = {
oidcDomains?: Domain[];
accessTokenDomains?: Domain[];
showAccessToken: boolean;
- convertAllRequestsToCorsExceptNavigate?: boolean,
- setAccessTokenToNavigateRequests?: boolean,
+ convertAllRequestsToCorsExceptNavigate?: boolean;
+ setAccessTokenToNavigateRequests?: boolean;
demonstratingProofOfPossession?:boolean;
demonstratingProofOfPossessionOnlyWhenDpopHeaderPresent?:boolean;
demonstratingProofOfPossessionConfiguration?: DemonstratingProofOfPossessionConfiguration;
@@ -12,11 +12,11 @@ export type DomainDetails = {
}
export interface DemonstratingProofOfPossessionConfiguration {
- generateKeyAlgorithm: RsaHashedKeyGenParams | EcKeyGenParams,
- digestAlgorithm: AlgorithmIdentifier,
- importKeyAlgorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | AesKeyAlgorithm,
- signAlgorithm: AlgorithmIdentifier | RsaPssParams | EcdsaParams,
- jwtHeaderAlgorithm: string
+ generateKeyAlgorithm: RsaHashedKeyGenParams | EcKeyGenParams;
+ digestAlgorithm: AlgorithmIdentifier;
+ importKeyAlgorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | AesKeyAlgorithm;
+ signAlgorithm: AlgorithmIdentifier | RsaPssParams | EcdsaParams;
+ jwtHeaderAlgorithm: string;
}
export type Domain = string | RegExp;
@@ -83,8 +83,8 @@ export type OidcConfig = {
sessionState?: string | null;
items?: MessageData;
hideAccessToken: boolean;
- convertAllRequestsToCorsExceptNavigate: boolean,
- setAccessTokenToNavigateRequests: boolean,
+ convertAllRequestsToCorsExceptNavigate: boolean;
+ setAccessTokenToNavigateRequests: boolean;
demonstratingProofOfPossessionNonce: string | null;
demonstratingProofOfPossessionJwkJson: string | null;
demonstratingProofOfPossessionOnlyWhenDpopHeaderPresent: boolean;
diff --git a/packages/oidc-client-service-worker/src/utils/__tests__/codeVerifier.spec.ts b/packages/oidc-client-service-worker/src/utils/__tests__/codeVerifier.spec.ts
index 262e10ff4..c46ba60db 100644
--- a/packages/oidc-client-service-worker/src/utils/__tests__/codeVerifier.spec.ts
+++ b/packages/oidc-client-service-worker/src/utils/__tests__/codeVerifier.spec.ts
@@ -1,6 +1,6 @@
import { describe, expect, it } from 'vitest';
-import { replaceCodeVerifier, extractConfigurationNameFromCodeVerifier } from '../codeVerifier';
+import { extractConfigurationNameFromCodeVerifier,replaceCodeVerifier } from '../codeVerifier';
describe('replaceCodeVerifier should', () => {
it.each([
diff --git a/packages/oidc-client-service-worker/src/utils/__tests__/tokens.spec.ts b/packages/oidc-client-service-worker/src/utils/__tests__/tokens.spec.ts
index 725609b77..f62911e58 100644
--- a/packages/oidc-client-service-worker/src/utils/__tests__/tokens.spec.ts
+++ b/packages/oidc-client-service-worker/src/utils/__tests__/tokens.spec.ts
@@ -39,7 +39,7 @@ describe('tokens', () => {
"name": "ƴǢÁìÇ 小名-ホルヘ",
"preferred_username": "testingcharacters@inventedmail.com",
"given_name": "ƴǢÁìÇ",
- "family_name": "小名-ホルヘ"
+ "family_name": "小名-ホルヘ",
}],
[
"eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyLCI_IjoiYWE_In0",
@@ -48,8 +48,8 @@ describe('tokens', () => {
"iat": 1516239022,
"name": "John Doe",
"sub": "1234567890",
- }
- ]
+ },
+ ],
])('parseJwtShouldExtractData', (claimsPart, expectedResult) => {
it('should parseJwtShouldExtractData ', async () => {
const result = parseJwt(claimsPart);
diff --git a/packages/oidc-client-service-worker/src/utils/codeVerifier.ts b/packages/oidc-client-service-worker/src/utils/codeVerifier.ts
index f0f175c19..d71749c9e 100644
--- a/packages/oidc-client-service-worker/src/utils/codeVerifier.ts
+++ b/packages/oidc-client-service-worker/src/utils/codeVerifier.ts
@@ -12,4 +12,4 @@ export const extractConfigurationNameFromCodeVerifier = (chaine:string):string[]
} else {
return null;
}
-}
+};
diff --git a/packages/oidc-client-service-worker/src/utils/tokens.ts b/packages/oidc-client-service-worker/src/utils/tokens.ts
index 0ea1561d3..a489bb812 100644
--- a/packages/oidc-client-service-worker/src/utils/tokens.ts
+++ b/packages/oidc-client-service-worker/src/utils/tokens.ts
@@ -6,7 +6,7 @@ import {
OidcConfig,
OidcConfiguration,
OidcServerConfiguration,
- Tokens
+ Tokens,
} from '../types';
import {countLetter} from './strings';
@@ -14,7 +14,7 @@ export const parseJwt = (payload: string) => {
return JSON.parse(
b64DecodeUnicode(payload.replaceAll(/-/g, '+').replaceAll(/_/g, '/')),
);
-}
+};
function b64DecodeUnicode(str: string) {
return decodeURIComponent(
Array.prototype.map
@@ -240,7 +240,7 @@ function hideTokens(currentDatabaseElement: OidcConfig, currentTabId: string) {
return new Response(body, {
status: response.status,
statusText: response.statusText,
- headers: newHeaders
+ headers: newHeaders,
});
});
};
diff --git a/packages/oidc-client/bin/copy-service-worker-files.mjs b/packages/oidc-client/bin/copy-service-worker-files.mjs
index 599985339..9553fbb25 100644
--- a/packages/oidc-client/bin/copy-service-worker-files.mjs
+++ b/packages/oidc-client/bin/copy-service-worker-files.mjs
@@ -1,5 +1,7 @@
-import path from 'path';
+/* global console, process */
+/* eslint no-console: "off" */
import fs from 'fs';
+import path from 'path';
import { fileURLToPath } from 'url';
try {
@@ -24,7 +26,7 @@ try {
}
await fs.promises.copyFile(src, dest);
console.log(`[${script_prefix}:copy] ${dest}`);
- return true
+ return true;
};
const fileExists = (path) => {
@@ -53,13 +55,13 @@ try {
const success = await copyFile(
path.join(srcDir, file.fileName),
path.join(destinationDir, file.fileName),
- file.overwrite
+ file.overwrite,
);
if(!success){
await copyFile(
path.join(srcDirFallback, file.fileName),
path.join(destinationDir, file.fileName),
- file.overwrite
+ file.overwrite,
);
}
}
diff --git a/packages/oidc-client/src/checkSession.ts b/packages/oidc-client/src/checkSession.ts
index c313c8c99..496b9cc67 100644
--- a/packages/oidc-client/src/checkSession.ts
+++ b/packages/oidc-client/src/checkSession.ts
@@ -1,9 +1,9 @@
import { CheckSessionIFrame } from './checkSessionIFrame.js';
+import Oidc from "./oidc";
import { _silentLoginAsync, SilentLoginResponse } from './silentLogin.js';
import { OidcConfiguration } from './types.js';
-import Oidc from "./oidc";
-// eslint-disable-next-line @typescript-eslint/ban-types
+
export const startCheckSessionAsync = (oidc:Oidc, oidcDatabase:any, configuration :OidcConfiguration) => (checkSessionIFrameUri, clientId, sessionState, isSilentSignin = false) => {
const silentLoginAsync = (extras, state = undefined, scope = undefined):Promise => {
return _silentLoginAsync(oidc.configurationName, configuration, oidc.publishEvent.bind(oidc))(extras, state, scope);
@@ -39,7 +39,7 @@ export const startCheckSessionAsync = (oidc:Oidc, oidcDatabase:any, configuratio
} else {
console.debug('SessionMonitor._callback: Different subject signed into OP:', iFrameIdTokenPayload.sub);
}
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
+
}).catch(async (e) => {
console.warn('SessionMonitor._callback: Silent login failed, logging out other tabs:', e);
// eslint-disable-next-line @typescript-eslint/no-unused-vars
diff --git a/packages/oidc-client/src/fetch.ts b/packages/oidc-client/src/fetch.ts
index 1d33fc86d..e93ee2a99 100644
--- a/packages/oidc-client/src/fetch.ts
+++ b/packages/oidc-client/src/fetch.ts
@@ -1,6 +1,5 @@
-import {Fetch} from "./types";
-import {OidcClient} from "./oidcClient";
-import {getValidTokenAsync} from "./parseTokens";
+import {getValidTokenAsync} from "./parseTokens";
+import {Fetch} from "./types";
// @ts-ignore
export const fetchWithTokens = (fetch: Fetch, oidcClient: Oidc | null, demonstrating_proof_of_possession:boolean=false) : Fetch => async (...params: Parameters) :Promise => {
diff --git a/packages/oidc-client/src/index.ts b/packages/oidc-client/src/index.ts
index a5f0906b2..b95075424 100644
--- a/packages/oidc-client/src/index.ts
+++ b/packages/oidc-client/src/index.ts
@@ -1,21 +1,18 @@
+export type { ILOidcLocation } from './location.js';
+export { OidcLocation } from './location.js';
export { getFetchDefault } from './oidc.js';
-export { TokenRenewMode } from './parseTokens.js';
-export { getParseQueryStringFromLocation, getPath } from './route-utils';
-
+export type { OidcUserInfo } from './oidcClient.js';
+export { OidcClient } from './oidcClient.js';
export type {
- Tokens
+ Tokens,
} from './parseTokens.js';
-
+export { TokenRenewMode } from './parseTokens.js';
+export { getParseQueryStringFromLocation, getPath } from './route-utils';
export type {
AuthorityConfiguration,
Fetch,
OidcConfiguration,
- StringMap
+ StringMap,
} from './types.js';
-
-export { OidcLocation } from './location.js';
-export type { ILOidcLocation } from './location.js';
export { TokenAutomaticRenewMode } from './types.js';
-export { OidcClient } from './oidcClient.js';
-export type { OidcUserInfo } from './oidcClient.js';
diff --git a/packages/oidc-client/src/initSession.ts b/packages/oidc-client/src/initSession.ts
index e01b591ae..46d5219a1 100644
--- a/packages/oidc-client/src/initSession.ts
+++ b/packages/oidc-client/src/initSession.ts
@@ -46,7 +46,7 @@ export const initSession = (configurationName, storage = sessionStorage) => {
storage[`oidc.dpop_nonce.${configurationName}`] = dpopNonce;
};
- const getDemonstratingProofOfPossessionNonce = () => {
+ const getDemonstratingProofOfPossessionNonce = (): string => {
return storage[`oidc.dpop_nonce.${configurationName}`];
};
@@ -57,7 +57,7 @@ export const initSession = (configurationName, storage = sessionStorage) => {
return JSON.stringify({ tokens: JSON.parse(storage[`oidc.${configurationName}`]).tokens });
};
- let getLoginParamsCache = {};
+ const getLoginParamsCache = {};
const setLoginParams = (data) => {
getLoginParamsCache[configurationName] = data;
storage[`oidc.login.${configurationName}`] = JSON.stringify(data);
diff --git a/packages/oidc-client/src/initWorker.ts b/packages/oidc-client/src/initWorker.ts
index 19ae12b25..80999d2b5 100644
--- a/packages/oidc-client/src/initWorker.ts
+++ b/packages/oidc-client/src/initWorker.ts
@@ -1,8 +1,8 @@
+import {ILOidcLocation} from "./location";
import { parseOriginalTokens } from './parseTokens.js';
import timer from './timer.js';
import { OidcConfiguration } from './types.js';
import codeVersion from './version.js';
-import {ILOidcLocation} from "./location";
let keepAliveServiceWorkerTimeoutId = null;
let keepAliveController;
@@ -36,14 +36,14 @@ const isServiceWorkerProxyActiveAsync = (service_worker_keep_alive_path='/') =>
}).catch(error => { console.log(error); });
};
-export const defaultServiceWorkerUpdateRequireCallback = (location:ILOidcLocation) => async (registration: any, stopKeepAlive: Function) => {
+export const defaultServiceWorkerUpdateRequireCallback = (location:ILOidcLocation) => async (registration: any, stopKeepAlive: ()=>void) => {
stopKeepAlive();
await registration.update();
const isSuccess = await registration.unregister();
- console.log(`Service worker unregistering ${isSuccess}`)
+ console.log(`Service worker unregistration ${isSuccess ? 'successful' : 'failed'}`);
await sleepAsync({milliseconds: 2000});
location.reload();
-}
+};
@@ -165,7 +165,7 @@ export const initWorkerAsync = async(configuration, configurationName) => {
return { nonce };
};
- let getLoginParamsCache = {};
+ const getLoginParamsCache = {};
const setLoginParams = (data) => {
getLoginParamsCache[configurationName] = data;
localStorage[`oidc.login.${configurationName}`] = JSON.stringify(data);
diff --git a/packages/oidc-client/src/initWorkerOption.ts b/packages/oidc-client/src/initWorkerOption.ts
index dc1ddabed..0307b696a 100644
--- a/packages/oidc-client/src/initWorkerOption.ts
+++ b/packages/oidc-client/src/initWorkerOption.ts
@@ -130,4 +130,4 @@ export const activateServiceWorker : ServiceWorkerActivate = () : boolean =>{
const operatingSystem = getOperatingSystem(navigator);
return !excludeOs(operatingSystem);
-}
\ No newline at end of file
+};
\ No newline at end of file
diff --git a/packages/oidc-client/src/jwt.ts b/packages/oidc-client/src/jwt.ts
index 4aadb41fe..fcb1b8f4d 100644
--- a/packages/oidc-client/src/jwt.ts
+++ b/packages/oidc-client/src/jwt.ts
@@ -46,7 +46,7 @@ export const uint8ToUrlBase64 =(uint8: Uint8Array) => {
bin += String.fromCharCode(code);
});
return binToUrlBase64(bin);
-}
+};
// UCS-2 String to URL-Safe Base64
//
@@ -60,16 +60,16 @@ export const defaultDemonstratingProofOfPossessionConfiguration: DemonstratingPr
importKeyAlgorithm: {
name: 'ECDSA',
namedCurve: 'P-256',
- hash: {name: 'ES256'}
+ hash: {name: 'ES256'},
},
signAlgorithm: {name: 'ECDSA', hash: {name: 'SHA-256'}},
generateKeyAlgorithm: {
name: 'ECDSA',
- namedCurve: 'P-256'
+ namedCurve: 'P-256',
},
digestAlgorithm: { name: 'SHA-256' },
- jwtHeaderAlgorithm : 'ES256'
-}
+ jwtHeaderAlgorithm : 'ES256',
+};
// @ts-ignore
@@ -100,7 +100,7 @@ const sign = (w:any) => async (jwk, headers, claims, demonstratingProofOfPossess
protected: strToUrlBase64(JSON.stringify(headers)),
// @ts-ignore
// JWT "claims" are really a JSON-defined JWS "payload"
- payload: strToUrlBase64(JSON.stringify(claims))
+ payload: strToUrlBase64(JSON.stringify(claims)),
};
// To import as EC (ECDSA, P-256, SHA-256, ES256)
@@ -133,8 +133,7 @@ const sign = (w:any) => async (jwk, headers, claims, demonstratingProofOfPossess
return `${jws.protected}.${jws.payload}.${jws.signature}`;
};
-export var JWT = {sign};
-
+export const JWT = {sign};
// @ts-ignore
const generate = (w:any) => async (generateKeyAlgorithm: RsaHashedKeyGenParams | EcKeyGenParams) => {
@@ -161,7 +160,7 @@ const neuter = jwk => {
const EC = {
generate,
- neuter
+ neuter,
};
// @ts-ignore
const thumbprint = (w:any) => async (jwk, digestAlgorithm: AlgorithmIdentifier) => {
@@ -186,9 +185,9 @@ const thumbprint = (w:any) => async (jwk, digestAlgorithm: AlgorithmIdentifier)
// but we're only dealing with P-256
const hash = await w.crypto.subtle.digest(digestAlgorithm, strToUint8(sortedPub));
return uint8ToUrlBase64(new Uint8Array(hash));
-}
+};
-export var JWK = {thumbprint};
+export const JWK = {thumbprint};
export const generateJwkAsync = (w:any) => async (generateKeyAlgorithm: RsaHashedKeyGenParams | EcKeyGenParams) => {
// @ts-ignore
@@ -197,7 +196,7 @@ export const generateJwkAsync = (w:any) => async (generateKeyAlgorithm: RsaHashe
// @ts-ignore
// console.info('Public Key:', JSON.stringify(EC.neuter(jwk)));
return jwk;
-}
+};
export const generateJwtDemonstratingProofOfPossessionAsync = (w:any) => (demonstratingProofOfPossessionConfiguration: DemonstratingProofOfPossessionConfiguration) => async (jwk, method = 'POST', url: string, extrasClaims={}) => {
@@ -212,10 +211,10 @@ export const generateJwtDemonstratingProofOfPossessionAsync = (w:any) => (demons
// @ts-ignore
const kid = await JWK.thumbprint(w)(jwk, demonstratingProofOfPossessionConfiguration.digestAlgorithm);
// @ts-ignore
- const jwt = await JWT.sign(w)(jwk, { kid: kid }, claims, demonstratingProofOfPossessionConfiguration)
+ const jwt = await JWT.sign(w)(jwk, { kid: kid }, claims, demonstratingProofOfPossessionConfiguration);
// console.info('JWT:', jwt);
return jwt;
-}
+};
const guid = () => {
// RFC4122: The version 4 UUID is meant for generating UUIDs from truly-random or
diff --git a/packages/oidc-client/src/keepSession.ts b/packages/oidc-client/src/keepSession.ts
index e863229cd..4f18b36ea 100644
--- a/packages/oidc-client/src/keepSession.ts
+++ b/packages/oidc-client/src/keepSession.ts
@@ -1,9 +1,9 @@
-import {initWorkerAsync} from "./initWorker";
-import {autoRenewTokens} from "./renewTokens";
+import {eventNames} from "./events";
import {initSession} from "./initSession";
-import {setTokens} from "./parseTokens";
-import {eventNames} from "./events";
+import {initWorkerAsync} from "./initWorker";
import Oidc from "./oidc";
+import {setTokens} from "./parseTokens";
+import {autoRenewTokens} from "./renewTokens";
export const tryKeepSessionAsync = async (oidc: Oidc) =>{
@@ -81,4 +81,4 @@ export const tryKeepSessionAsync = async (oidc: Oidc) =>{
oidc.publishEvent(eventNames.tryKeepExistingSessionAsync_error, 'tokens inside ServiceWorker are invalid');
return false;
}
-}
\ No newline at end of file
+};
\ No newline at end of file
diff --git a/packages/oidc-client/src/login.ts b/packages/oidc-client/src/login.ts
index 95547c304..54d3ab234 100644
--- a/packages/oidc-client/src/login.ts
+++ b/packages/oidc-client/src/login.ts
@@ -2,16 +2,16 @@ import {generateRandom} from './crypto.js';
import {eventNames} from './events.js';
import {initSession} from './initSession.js';
import {initWorkerAsync} from './initWorker.js';
+import {generateJwkAsync, generateJwtDemonstratingProofOfPossessionAsync} from "./jwt";
+import {ILOidcLocation} from "./location";
+import Oidc from "./oidc";
import {isTokensOidcValid} from './parseTokens.js';
import {
performAuthorizationRequestAsync,
- performFirstTokenRequestAsync
+ performFirstTokenRequestAsync,
} from './requests.js';
import {getParseQueryStringFromLocation} from './route-utils.js';
import {OidcConfiguration, StringMap} from './types.js';
-import {generateJwkAsync, generateJwtDemonstratingProofOfPossessionAsync} from "./jwt";
-import {ILOidcLocation} from "./location";
-import Oidc from "./oidc";
// eslint-disable-next-line @typescript-eslint/ban-types
export const defaultLoginAsync = (configurationName:string, configuration:OidcConfiguration, publishEvent :(string, any)=>void, initAsync:Function, oidcLocation: ILOidcLocation) => (callbackPath:string = undefined, extras:StringMap = null, isSilentSignin = false, scope:string = undefined) => {
diff --git a/packages/oidc-client/src/logout.spec.ts b/packages/oidc-client/src/logout.spec.ts
index c6b9e8ff5..06e9317bd 100644
--- a/packages/oidc-client/src/logout.spec.ts
+++ b/packages/oidc-client/src/logout.spec.ts
@@ -2,8 +2,8 @@
import { describe, expect, it, vi } from 'vitest';
+import { ILOidcLocation } from "./location";
import { logoutAsync } from "./logout";
-import {ILOidcLocation, OidcLocation} from "./location";
describe('Logout test suite', () => {
const expectedFinalUrl = "http://api/connect/endsession?id_token_hint=abcd&post_logout_redirect_uri=http%3A%2F%2Flocalhost%3A4200%2Flogged_out";
diff --git a/packages/oidc-client/src/logout.ts b/packages/oidc-client/src/logout.ts
index d422a9a8d..8c1c838be 100644
--- a/packages/oidc-client/src/logout.ts
+++ b/packages/oidc-client/src/logout.ts
@@ -1,10 +1,10 @@
+import {eventNames} from "./events";
import { initSession } from './initSession.js';
import { initWorkerAsync } from './initWorker.js';
+import {ILOidcLocation} from "./location";
import { performRevocationRequestAsync, TOKEN_TYPE } from './requests.js';
import timer from './timer.js';
import { StringMap } from './types.js';
-import {ILOidcLocation} from "./location";
-import {eventNames} from "./events";
export const oidcLogoutTokens = {
access_token: 'access_token',
@@ -23,7 +23,7 @@ const extractExtras = (extras: StringMap, postKey: string):StringMap => {
return postExtras;
}
return postExtras;
-}
+};
const keepExtras = (extras: StringMap):StringMap => {
const postExtras : StringMap = {};
@@ -36,7 +36,7 @@ const keepExtras = (extras: StringMap):StringMap => {
return postExtras;
}
return postExtras;
-}
+};
export const destroyAsync = (oidc) => async (status) => {
timer.clearTimeout(oidc.timeoutId);
@@ -70,7 +70,7 @@ export const logoutAsync = (oidc,
if (callbackPathOrUrl) {
isUri = callbackPathOrUrl.includes('https://') || callbackPathOrUrl.includes('http://');
}
- const url = isUri ? callbackPathOrUrl : oicLocation.getOrigin() + path
+ const url = isUri ? callbackPathOrUrl : oicLocation.getOrigin() + path;
// @ts-ignore
const idToken = oidc.tokens ? oidc.tokens.idToken : '';
try {
@@ -105,12 +105,10 @@ export const logoutAsync = (oidc,
console.warn('logoutAsync: error when revoking tokens, if the error persist, you ay configure property logout_tokens_to_invalidate from configuration to avoid this error');
console.warn(exception);
}
- // @ts-ignore
- const sub = oidc.tokens && oidc.tokens.idTokenPayload ? oidc.tokens.idTokenPayload.sub : null;
-
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
+ const sub = oidc.tokens?.idTokenPayload?.sub ?? null;
+
await oidc.destroyAsync('LOGGED_OUT');
- for (const [key, itemOidc] of Object.entries(oidcDatabase)) {
+ for (const [, itemOidc] of Object.entries(oidcDatabase)) {
if (itemOidc !== oidc) {
// @ts-ignore
await oidc.logoutSameTabAsync(oidc.configuration.client_id, sub);
@@ -120,7 +118,7 @@ export const logoutAsync = (oidc,
}
const oidcExtras = extractExtras(extras, ':oidc');
- let noReload = oidcExtras && oidcExtras['no_reload'] === 'true';
+ const noReload = oidcExtras && oidcExtras['no_reload'] === 'true';
if(noReload) {
return;
diff --git a/packages/oidc-client/src/oidc.ts b/packages/oidc-client/src/oidc.ts
index 59f6d2532..184257824 100644
--- a/packages/oidc-client/src/oidc.ts
+++ b/packages/oidc-client/src/oidc.ts
@@ -1,14 +1,22 @@
import {startCheckSessionAsync as defaultStartCheckSessionAsync} from './checkSession.js';
import {CheckSessionIFrame} from './checkSessionIFrame.js';
+import {base64urlOfHashOfASCIIEncodingAsync} from "./crypto";
import {eventNames} from './events.js';
import {initSession} from './initSession.js';
-import {defaultServiceWorkerUpdateRequireCallback, initWorkerAsync, sleepAsync} from './initWorker.js';
+import {defaultServiceWorkerUpdateRequireCallback, initWorkerAsync } from './initWorker.js';
+import {activateServiceWorker} from "./initWorkerOption";
+import {
+ defaultDemonstratingProofOfPossessionConfiguration,
+ generateJwtDemonstratingProofOfPossessionAsync,
+} from "./jwt";
+import {tryKeepSessionAsync} from "./keepSession";
+import {ILOidcLocation, OidcLocation} from "./location";
import {defaultLoginAsync, loginCallbackAsync} from './login.js';
import {destroyAsync, logoutAsync} from './logout.js';
-import {TokenRenewMode, Tokens,} from './parseTokens.js';
+import {TokenRenewMode, Tokens} from './parseTokens.js';
import {
autoRenewTokens,
- renewTokensAndStartTimerAsync
+ renewTokensAndStartTimerAsync,
} from './renewTokens.js';
import {fetchFromIssuer} from './requests.js';
import {getParseQueryStringFromLocation} from './route-utils.js';
@@ -16,14 +24,6 @@ import defaultSilentLoginAsync from './silentLogin.js';
import timer from './timer.js';
import {AuthorityConfiguration, Fetch, OidcConfiguration, StringMap, TokenAutomaticRenewMode} from './types.js';
import {userInfoAsync} from './user.js';
-import {base64urlOfHashOfASCIIEncodingAsync} from "./crypto";
-import {
- defaultDemonstratingProofOfPossessionConfiguration,
- generateJwtDemonstratingProofOfPossessionAsync
-} from "./jwt";
-import {ILOidcLocation, OidcLocation} from "./location";
-import {activateServiceWorker} from "./initWorkerOption";
-import {tryKeepSessionAsync} from "./keepSession";
@@ -305,20 +305,18 @@ Please checkout that you are using OIDC hook inside a {
const currentTimeUnixSecond = new Date().getTime() / 1000;
@@ -29,9 +29,9 @@ describe('ParseTokens test Suite', () => {
issuedAt,
},
configuration: { token_automatic_renew_mode: TokenAutomaticRenewMode.AutomaticBeforeTokenExpiration},
- renewTokensAsync: async (extras: StringMap) => {
+ renewTokensAsync: async (_extras: StringMap) => {
await sleepAsync({milliseconds:10});
- }
+ },
};
const result = await getValidTokenAsync(oidc, 1, 1);
expect(result.isTokensValid).toEqual(expectIsValidToken);
@@ -47,7 +47,7 @@ describe('ParseTokens test Suite', () => {
"name": "ƴǢÁìÇ 小名-ホルヘ",
"preferred_username": "testingcharacters@inventedmail.com",
"given_name": "ƴǢÁìÇ",
- "family_name": "小名-ホルヘ"
+ "family_name": "小名-ホルヘ",
}],
[
"eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyLCI_IjoiYWE_In0",
@@ -56,8 +56,8 @@ describe('ParseTokens test Suite', () => {
"iat": 1516239022,
"name": "John Doe",
"sub": "1234567890",
- }
- ]
+ },
+ ],
])('parseJwtShouldExtractData', (claimsPart, expectedResult) => {
it('should parseJwtShouldExtractData ', async () => {
const result = parseJwt(claimsPart);
@@ -74,14 +74,14 @@ describe('ParseTokens test Suite', () => {
"token_type": "Bearer",
"expires_in": "900", // Here a string instead of a number
"refresh_token": refresh_token,
- "id_token": id_token
+ "id_token": id_token,
}],
[{
"access_token": access_token,
"token_type": "Bearer",
"expires_in": 900,
"refresh_token": refresh_token,
- "id_token": id_token
+ "id_token": id_token,
}],
[{
"access_token": access_token,
@@ -89,7 +89,7 @@ describe('ParseTokens test Suite', () => {
"expires_in": 900,
"expiresAt": 1609987454, // Here expiresAt that come from Service Worker
"refresh_token": refresh_token,
- "id_token": id_token
+ "id_token": id_token,
}],
])('getValidTokenAsync', (tokens) => {
it('should parseOriginalTokens', async () => {
@@ -141,10 +141,10 @@ describe('ParseTokens test Suite', () => {
"profile",
"email",
"api",
- "offline_access"
+ "offline_access",
],
"amr": [
- "pwd"
+ "pwd",
],
"client_id": "interactive.public.short",
"sub": "2",
@@ -153,7 +153,7 @@ describe('ParseTokens test Suite', () => {
"name": "Bob Smith",
"email": "BobSmith@email.com",
"sid": "345ABC88E6E50AF1273ED415A7FD6A23",
- "jti": "E3CF3853D77AC90ABC774266CD381C43"
+ "jti": "E3CF3853D77AC90ABC774266CD381C43",
},
"idTokenPayload": {
"iss": "https://demo.duendesoftware.com",
@@ -162,17 +162,17 @@ describe('ParseTokens test Suite', () => {
"exp": 1706540558,
"aud": "interactive.public.short",
"amr": [
- "pwd"
+ "pwd",
],
"nonce": "NONCE_SECURED_BY_OIDC_SERVICE_WORKER_default",
"at_hash": "NZvaGGYbXhzTMZUqR9MbNg",
"sid": "345ABC88E6E50AF1273ED415A7FD6A23",
"sub": "2",
"auth_time": 1706531665,
- "idp": "local"
+ "idp": "local",
},
- "expiresAt": 1706540333
- }
+ "expiresAt": 1706540333,
+ };
describe.each([
[testTokens, null, TokenRenewMode.access_token_invalid, () => {}],
@@ -182,11 +182,8 @@ describe('ParseTokens test Suite', () => {
}],
])('setTokens', (tokens, oldTokens, tokenRenewMode, validationFunction) => {
it('should setTokens return updatedTokens' , async () => {
- const oidc = {
- idTokenPayload,
- };
const newTokens = setTokens(tokens, oldTokens, tokenRenewMode);
- validationFunction(newTokens)
+ validationFunction(newTokens);
});
});
diff --git a/packages/oidc-client/src/parseTokens.ts b/packages/oidc-client/src/parseTokens.ts
index 82d2bfeff..1823418b7 100644
--- a/packages/oidc-client/src/parseTokens.ts
+++ b/packages/oidc-client/src/parseTokens.ts
@@ -1,5 +1,5 @@
import {sleepAsync} from './initWorker.js';
-import {OidcConfiguration, StringMap, TokenAutomaticRenewMode} from "./types";
+import {StringMap, TokenAutomaticRenewMode} from "./types";
const b64DecodeUnicode = (str) =>
decodeURIComponent(Array.prototype.map.call(atob(str), (c) => '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2)).join(''));
@@ -175,7 +175,7 @@ export type ValidToken = {
export interface OidcToken{
tokens?: Tokens;
- configuration: { token_automatic_renew_mode?: TokenAutomaticRenewMode; },
+ configuration: { token_automatic_renew_mode?: TokenAutomaticRenewMode };
renewTokensAsync: (extras: StringMap) => Promise;
}
diff --git a/packages/oidc-client/src/renewTokens.ts b/packages/oidc-client/src/renewTokens.ts
index 1fa25211d..f4d2edbb8 100644
--- a/packages/oidc-client/src/renewTokens.ts
+++ b/packages/oidc-client/src/renewTokens.ts
@@ -1,12 +1,12 @@
+import {eventNames} from "./events";
import {initSession} from './initSession.js';
import {initWorkerAsync, sleepAsync} from './initWorker.js';
import Oidc from './oidc.js';
import {computeTimeLeft, isTokensOidcValid, setTokens, Tokens} from './parseTokens.js';
+import {performTokenRequestAsync} from "./requests";
+import {_silentLoginAsync} from "./silentLogin";
import timer from './timer.js';
import {OidcConfiguration, StringMap, TokenAutomaticRenewMode} from './types.js';
-import {_silentLoginAsync} from "./silentLogin";
-import {performTokenRequestAsync} from "./requests";
-import {eventNames} from "./events";
async function syncTokens(oidc:Oidc, forceRefresh: boolean, extras: StringMap) {
const updateTokens = (tokens) => {
@@ -40,7 +40,7 @@ const loadLatestTokensAsync = async (oidc:Oidc, configuration:OidcConfiguration)
tokens = setTokens(tokens, oidc.tokens, configuration.token_renew_mode);
return tokens;
}
-}
+};
export async function renewTokensAndStartTimerAsync(oidc, forceRefresh = false, extras:StringMap = null) {
@@ -92,7 +92,7 @@ export const synchroniseTokensStatus ={
TOKENS_VALID:'TOKENS_VALID',
TOKEN_UPDATED_BY_ANOTHER_TAB_TOKENS_VALID: 'TOKEN_UPDATED_BY_ANOTHER_TAB_TOKENS_VALID',
LOGOUT_FROM_ANOTHER_TAB: 'LOGOUT_FROM_ANOTHER_TAB',
- REQUIRE_SYNC_TOKENS: 'REQUIRE_SYNC_TOKENS'
+ REQUIRE_SYNC_TOKENS: 'REQUIRE_SYNC_TOKENS',
};
export const syncTokensInfoAsync = (oidc: Oidc) => async (configuration:OidcConfiguration, configurationName: string, currentTokens: Tokens, forceRefresh = false) => {
@@ -122,7 +122,9 @@ export const syncTokensInfoAsync = (oidc: Oidc) => async (configuration:OidcConf
nonce = await serviceWorker.getNonceAsync();
} else {
const session = initSession(configurationName, configuration.storage ?? sessionStorage);
- let { tokens, status } = await session.initAsync();
+ const initAsyncResponse = await session.initAsync();
+ let { tokens } = initAsyncResponse;
+ const { status } = initAsyncResponse;
if(tokens){
tokens = setTokens(tokens, oidc.tokens, configuration.token_renew_mode);
}
@@ -145,7 +147,7 @@ export const syncTokensInfoAsync = (oidc: Oidc) => async (configuration:OidcConf
return { tokens: currentTokens, status: 'FORCE_REFRESH', nonce };
}
return { tokens: currentTokens, status, nonce };
-}
+};
const synchroniseTokensAsync = (oidc:Oidc) => async (index = 0, forceRefresh = false, extras:StringMap = null, updateTokens) =>{
@@ -159,7 +161,6 @@ const synchroniseTokensAsync = (oidc:Oidc) => async (index = 0, forceRefresh = f
numberTryOnline--;
oidc.publishEvent(eventNames.refreshTokensAsync, { message: `wait because navigator is offline try ${numberTryOnline}` });
}
- const isDocumentHidden = document.hidden;
const nextIndex = index + 1;
if (!extras) {
extras = {};
@@ -336,4 +337,4 @@ const synchroniseTokensAsync = (oidc:Oidc) => async (index = 0, forceRefresh = f
}, 1000);
});
}
-}
\ No newline at end of file
+};
\ No newline at end of file
diff --git a/packages/oidc-client/src/requests.ts b/packages/oidc-client/src/requests.ts
index 5321210f0..ff1d49780 100644
--- a/packages/oidc-client/src/requests.ts
+++ b/packages/oidc-client/src/requests.ts
@@ -1,9 +1,9 @@
import { getFromCache, setCache } from './cache.js';
import { deriveChallengeAsync, generateRandom } from './crypto.js';
+import {ILOidcLocation} from "./location";
import { OidcAuthorizationServiceConfiguration } from './oidc.js';
import { parseOriginalTokens } from './parseTokens.js';
import { Fetch, StringMap } from './types.js';
-import {ILOidcLocation} from "./location";
const oneHourSecond = 60 * 60;
export const fetchFromIssuer = (fetch) => async (openIdIssuerUrl: string, timeCacheSecond = oneHourSecond, storage = window.sessionStorage, timeoutMs = 10000):
@@ -128,7 +128,7 @@ export const performTokenRequestAsync = (fetch:Fetch) => async (url:string,
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8',
- ...headersExtras
+ ...headersExtras,
},
body: formBodyString,
}, timeoutMs);
@@ -136,7 +136,7 @@ export const performTokenRequestAsync = (fetch:Fetch) => async (url:string,
return {
success: false,
status: response.status,
- demonstratingProofOfPossessionNonce:null
+ demonstratingProofOfPossessionNonce:null,
};
}
const tokens = await response.json();
diff --git a/packages/oidc-client/src/silentLogin.ts b/packages/oidc-client/src/silentLogin.ts
index e5b2c1174..4f14a7c36 100644
--- a/packages/oidc-client/src/silentLogin.ts
+++ b/packages/oidc-client/src/silentLogin.ts
@@ -117,7 +117,7 @@ export const _silentLoginAsync = (configurationName:string, configuration:OidcCo
}
};
-// eslint-disable-next-line @typescript-eslint/ban-types
+
export const defaultSilentLoginAsync = (window, configurationName, configuration:OidcConfiguration, publishEvent :(string, any)=>void, oidc:any) => (extras:StringMap = null, scope:string = undefined) => {
extras = { ...extras };
diff --git a/packages/oidc-client/src/types.ts b/packages/oidc-client/src/types.ts
index a2dd29267..0aa4faf75 100644
--- a/packages/oidc-client/src/types.ts
+++ b/packages/oidc-client/src/types.ts
@@ -2,7 +2,7 @@ export type Fetch = typeof window.fetch;
export type LogoutToken = 'access_token' | 'refresh_token';
-export type ServiceWorkerUpdateRequireCallback = (registration:any, stopKeepAlive:Function) => Promise;
+export type ServiceWorkerUpdateRequireCallback = (registration:any, stopKeepAlive:()=>void) => Promise;
export type ServiceWorkerRegister = (serviceWorkerRelativeUrl:string) => Promise;
export type ServiceWorkerActivate = () => boolean;
@@ -44,11 +44,11 @@ export type OidcConfiguration = {
};
export interface DemonstratingProofOfPossessionConfiguration {
- generateKeyAlgorithm: RsaHashedKeyGenParams | EcKeyGenParams,
- digestAlgorithm: AlgorithmIdentifier,
- importKeyAlgorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | AesKeyAlgorithm,
- signAlgorithm: AlgorithmIdentifier | RsaPssParams | EcdsaParams,
- jwtHeaderAlgorithm: string
+ generateKeyAlgorithm: RsaHashedKeyGenParams | EcKeyGenParams;
+ digestAlgorithm: AlgorithmIdentifier;
+ importKeyAlgorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | AesKeyAlgorithm;
+ signAlgorithm: AlgorithmIdentifier | RsaPssParams | EcdsaParams;
+ jwtHeaderAlgorithm: string;
}
export interface StringMap {
diff --git a/packages/oidc-client/src/user.ts b/packages/oidc-client/src/user.ts
index 361b59c9b..44156795f 100644
--- a/packages/oidc-client/src/user.ts
+++ b/packages/oidc-client/src/user.ts
@@ -1,5 +1,5 @@
-import Oidc from "./oidc";
import {fetchWithTokens} from "./fetch";
+import Oidc from "./oidc";
export const userInfoAsync = (oidc:Oidc) => async (noCache = false, demonstrating_proof_of_possession=false) => {
if (oidc.userInfo != null && !noCache) {
diff --git a/packages/oidc-client/tests/setup.js b/packages/oidc-client/tests/setup.js
index aece2885f..5c4174199 100644
--- a/packages/oidc-client/tests/setup.js
+++ b/packages/oidc-client/tests/setup.js
@@ -1,11 +1,11 @@
-import { configDefaults } from 'vitest/config'
-import {defineConfig} from "vite";
+import {defineConfig} from "vite";
+import { configDefaults } from 'vitest/config';
export default defineConfig({
test: {
exclude:[
...configDefaults.exclude,
- 'public/*'
- ]
+ 'public/*',
+ ],
},
});
\ No newline at end of file
diff --git a/packages/react-oidc/bin/copy-service-worker-files.mjs b/packages/react-oidc/bin/copy-service-worker-files.mjs
index 3fe82d871..3625811ee 100644
--- a/packages/react-oidc/bin/copy-service-worker-files.mjs
+++ b/packages/react-oidc/bin/copy-service-worker-files.mjs
@@ -1,5 +1,7 @@
-import path from 'path';
+/* global console, process */
+/* eslint no-console: "off" */
import fs from 'fs';
+import path from 'path';
import { fileURLToPath } from 'url';
try {
@@ -24,7 +26,7 @@ try {
}
await fs.promises.copyFile(src, dest);
console.log(`[${script_prefix}:copy] ${dest}`);
- return true
+ return true;
};
const fileExists = (path) => {
@@ -53,13 +55,13 @@ try {
const success = await copyFile(
path.join(srcDir, file.fileName),
path.join(destinationDir, file.fileName),
- file.overwrite
+ file.overwrite,
);
if(!success){
await copyFile(
path.join(srcDirFallback, file.fileName),
path.join(destinationDir, file.fileName),
- file.overwrite
+ file.overwrite,
);
}
}
diff --git a/packages/react-oidc/src/OidcProvider.tsx b/packages/react-oidc/src/OidcProvider.tsx
index 41cd2625c..d51c70f9b 100644
--- a/packages/react-oidc/src/OidcProvider.tsx
+++ b/packages/react-oidc/src/OidcProvider.tsx
@@ -1,4 +1,4 @@
-import {Fetch, getFetchDefault, OidcConfiguration, OidcClient, ILOidcLocation, OidcLocation} from '@axa-fr/oidc-client';
+import {Fetch, getFetchDefault, ILOidcLocation, OidcClient, OidcConfiguration, OidcLocation} from '@axa-fr/oidc-client';
import { ComponentType, FC, PropsWithChildren, useEffect, useState } from 'react';
import AuthenticatingError from './core/default-component/AuthenticateError.component.js';
@@ -29,7 +29,7 @@ export type OidcProviderProps = {
withCustomHistory?: () => CustomHistory;
onEvent?: (configuration: string, name: string, data: any) => void;
getFetch?: () => Fetch;
- location?: ILOidcLocation
+ location?: ILOidcLocation;
};
export type OidcSessionProps = {
@@ -53,7 +53,7 @@ const OidcSession: FC> = ({ loadingComponent
return () => {
isMounted = false;
};
- // eslint-disable-next-line react-hooks/exhaustive-deps
+
}, [configurationName]);
const LoadingComponent = loadingComponent;
return (
@@ -98,7 +98,7 @@ export const OidcProvider: FC> = ({
const getOidc = (configurationName = 'default') => {
return OidcClient.getOrCreate(getFetch ?? getFetchDefault, location ?? new OidcLocation())(configuration, configurationName);
};
- // eslint-disable-next-line @typescript-eslint/naming-convention
+
const [loading, setLoading] = useState(true);
const [event, setEvent] = useState(defaultEventState);
const [currentConfigurationName, setConfigurationName] = useState('default');
@@ -154,7 +154,7 @@ export const OidcProvider: FC> = ({
previousOidc.removeEventSubscription(newSubscriptionId);
setEvent(defaultEventState);
};
- // eslint-disable-next-line react-hooks/exhaustive-deps
+
}, [configuration, configurationName]);
const SessionLostComponent = sessionLostComponent;
diff --git a/packages/react-oidc/src/OidcSecure.tsx b/packages/react-oidc/src/OidcSecure.tsx
index 0a44df84e..65de58fc5 100644
--- a/packages/react-oidc/src/OidcSecure.tsx
+++ b/packages/react-oidc/src/OidcSecure.tsx
@@ -1,4 +1,4 @@
-import { StringMap, OidcClient } from '@axa-fr/oidc-client';
+import { OidcClient,StringMap } from '@axa-fr/oidc-client';
import { FC, PropsWithChildren, useEffect } from 'react';
export type OidcSecureProps = {
diff --git a/packages/react-oidc/src/ReactOidc.tsx b/packages/react-oidc/src/ReactOidc.tsx
index 9a2aef457..1e0339d23 100644
--- a/packages/react-oidc/src/ReactOidc.tsx
+++ b/packages/react-oidc/src/ReactOidc.tsx
@@ -1,4 +1,4 @@
-import { StringMap, OidcClient, Tokens } from '@axa-fr/oidc-client';
+import { OidcClient, StringMap, Tokens } from '@axa-fr/oidc-client';
import { useEffect, useState } from 'react';
const defaultConfigurationName = 'default';
@@ -24,7 +24,7 @@ export const useOidc = (configurationName = defaultConfigurationName) => {
let isMounted = true;
const oidc = getOidc(configurationName);
setIsAuthenticated(defaultIsAuthenticated(getOidc, configurationName));
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
+
const newSubscriptionId = oidc.subscribeEvents((name: string, data: any) => {
if (name === OidcClient.eventNames.logout_from_another_tab || name === OidcClient.eventNames.logout_from_same_tab || name === OidcClient.eventNames.token_aquired) {
if (isMounted) {
@@ -36,7 +36,7 @@ export const useOidc = (configurationName = defaultConfigurationName) => {
isMounted = false;
oidc.removeEventSubscription(newSubscriptionId);
};
- // eslint-disable-next-line react-hooks/exhaustive-deps
+
}, [configurationName]);
const login = (callbackPath:string | undefined = undefined, extras:StringMap = null, silentLoginOnly = false) => {
@@ -99,7 +99,7 @@ export const useOidcAccessToken = (configurationName = defaultConfigurationName)
const tokens = oidc.tokens;
setAccessToken({ accessToken: tokens.accessToken, accessTokenPayload: tokens.accessTokenPayload });
}
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
+
const newSubscriptionId = oidc.subscribeEvents((name: string, data: any) => {
if (name === OidcClient.eventNames.token_renewed ||
name === OidcClient.eventNames.token_aquired ||
@@ -121,7 +121,7 @@ export const useOidcAccessToken = (configurationName = defaultConfigurationName)
isMounted = false;
oidc.removeEventSubscription(newSubscriptionId);
};
- // eslint-disable-next-line react-hooks/exhaustive-deps
+
}, [configurationName]);
return state;
};
@@ -155,7 +155,7 @@ export const useOidcIdToken = (configurationName = defaultConfigurationName) =>
const tokens = oidc.tokens;
setIDToken({ idToken: tokens.idToken, idTokenPayload: tokens.idTokenPayload });
}
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
+
const newSubscriptionId = oidc.subscribeEvents((name: string, data: any) => {
if (name === OidcClient.eventNames.token_renewed ||
name === OidcClient.eventNames.token_aquired ||
@@ -173,7 +173,7 @@ export const useOidcIdToken = (configurationName = defaultConfigurationName) =>
isMounted = false;
oidc.removeEventSubscription(newSubscriptionId);
};
- // eslint-disable-next-line react-hooks/exhaustive-deps
+
}, [configurationName]);
return state;
};
diff --git a/packages/react-oidc/src/User.ts b/packages/react-oidc/src/User.ts
index 53490a08b..0145cf68d 100644
--- a/packages/react-oidc/src/User.ts
+++ b/packages/react-oidc/src/User.ts
@@ -1,4 +1,4 @@
-import { type OidcUserInfo, OidcClient } from '@axa-fr/oidc-client';
+import { OidcClient,type OidcUserInfo } from '@axa-fr/oidc-client';
import { useEffect, useState } from 'react';
export enum OidcUserStatus {
diff --git a/packages/react-oidc/src/core/routes/OidcRoutes.tsx b/packages/react-oidc/src/core/routes/OidcRoutes.tsx
index 836211f7c..ab77f8ce6 100644
--- a/packages/react-oidc/src/core/routes/OidcRoutes.tsx
+++ b/packages/react-oidc/src/core/routes/OidcRoutes.tsx
@@ -26,7 +26,6 @@ const OidcRoutes: FC> = ({
silent_login_uri,
children, configurationName,
withCustomHistory = null,
- location,
}) => {
// This exist because in next.js window outside useEffect is null
const pathname = window ? getPath(window.location.href) : '';
diff --git a/packages/react-oidc/src/index.ts b/packages/react-oidc/src/index.ts
index ebfb520e6..e891b1c5d 100644
--- a/packages/react-oidc/src/index.ts
+++ b/packages/react-oidc/src/index.ts
@@ -6,9 +6,8 @@ export { OidcUserStatus, useOidcUser } from './User.js';
export type {
AuthorityConfiguration,
Fetch,
+ ILOidcLocation,
OidcConfiguration,
- StringMap,
- ILOidcLocation
-} from '@axa-fr/oidc-client';
-export { TokenRenewMode, OidcClient, TokenAutomaticRenewMode, OidcLocation } from '@axa-fr/oidc-client';
+ StringMap} from '@axa-fr/oidc-client';
export type { OidcUserInfo } from '@axa-fr/oidc-client';
+export { OidcClient, OidcLocation,TokenAutomaticRenewMode, TokenRenewMode } from '@axa-fr/oidc-client';
diff --git a/packages/react-oidc/vite.config.ts b/packages/react-oidc/vite.config.ts
index 7b4ed8c80..d5e468c07 100644
--- a/packages/react-oidc/vite.config.ts
+++ b/packages/react-oidc/vite.config.ts
@@ -19,7 +19,7 @@ export default defineConfig({
rollupOptions: {
external: [
...dependencies,
- 'react/jsx-runtime'
+ 'react/jsx-runtime',
],
output: {
globals: {
From 8797330ea5060a77b8d10a352ff166a33210f6aa Mon Sep 17 00:00:00 2001
From: Jason Finch
Date: Sat, 13 Jul 2024 13:21:51 +1000
Subject: [PATCH 05/12] refactor(lint): Fix minor lint issues
- Imports, unused variables,
- deprecated use of substr replaced with slice.
- remove await on non awaitable code.
---
examples/react-oidc-demo/src/MultiAuth.tsx | 2 +-
packages/oidc-client-service-worker/src/OidcServiceWorker.ts | 2 +-
packages/oidc-client/src/checkSession.ts | 3 +--
packages/oidc-client/src/checkSessionIFrame.ts | 2 +-
packages/oidc-client/src/oidc.ts | 2 +-
packages/oidc-client/src/oidcClient.ts | 2 +-
packages/oidc-client/src/silentLogin.ts | 2 +-
packages/react-oidc/src/core/routes/withRouter.tsx | 2 +-
8 files changed, 8 insertions(+), 9 deletions(-)
diff --git a/examples/react-oidc-demo/src/MultiAuth.tsx b/examples/react-oidc-demo/src/MultiAuth.tsx
index 94546178e..31abce013 100644
--- a/examples/react-oidc-demo/src/MultiAuth.tsx
+++ b/examples/react-oidc-demo/src/MultiAuth.tsx
@@ -16,7 +16,7 @@ const fetchWithLogs = (fetch: Fetch) => async (...params: Parameters) =>
return await fetch(url, options, ...rest);
};
-const MultiAuth = ({ configurationName, handleConfigurationChange }) => {;
+const MultiAuth = ({ configurationName, handleConfigurationChange }) => {
const { login, logout, isAuthenticated } = useOidc(configurationName);
const { isAuthenticated: isAuthenticatedDefault } = useOidc('default');
const [fname, setFname] = useState('');
diff --git a/packages/oidc-client-service-worker/src/OidcServiceWorker.ts b/packages/oidc-client-service-worker/src/OidcServiceWorker.ts
index 4cc166946..6e3ce4f71 100644
--- a/packages/oidc-client-service-worker/src/OidcServiceWorker.ts
+++ b/packages/oidc-client-service-worker/src/OidcServiceWorker.ts
@@ -15,11 +15,11 @@ import {
getDomains,
hideTokens,
isTokensValid,
+ normalizeUrl,
serializeHeaders,
sleep,
} from './utils';
import {extractConfigurationNameFromCodeVerifier, replaceCodeVerifier} from './utils/codeVerifier';
-import { normalizeUrl } from './utils/normalizeUrl';
import version from './version';
// @ts-ignore
diff --git a/packages/oidc-client/src/checkSession.ts b/packages/oidc-client/src/checkSession.ts
index 496b9cc67..3a399e8be 100644
--- a/packages/oidc-client/src/checkSession.ts
+++ b/packages/oidc-client/src/checkSession.ts
@@ -42,8 +42,7 @@ export const startCheckSessionAsync = (oidc:Oidc, oidcDatabase:any, configuratio
}).catch(async (e) => {
console.warn('SessionMonitor._callback: Silent login failed, logging out other tabs:', e);
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
- for (const [key, oidc] of Object.entries(oidcDatabase)) {
+ for (const [, oidc] of Object.entries(oidcDatabase)) {
// @ts-ignore
await oidc.logoutOtherTabAsync(configuration.client_id, idTokenPayload.sub);
}
diff --git a/packages/oidc-client/src/checkSessionIFrame.ts b/packages/oidc-client/src/checkSessionIFrame.ts
index 247cbb24e..60cac1e6c 100644
--- a/packages/oidc-client/src/checkSessionIFrame.ts
+++ b/packages/oidc-client/src/checkSessionIFrame.ts
@@ -19,7 +19,7 @@ export class CheckSessionIFrame {
this._interval = interval || DefaultInterval;
this._stopOnError = stopOnError;
const idx = url.indexOf('/', url.indexOf('//') + 2);
- this._frame_origin = url.substr(0, idx);
+ this._frame_origin = url.substring(0, idx);
this._frame = window.document.createElement('iframe');
this._frame.style.visibility = 'hidden';
this._frame.style.position = 'absolute';
diff --git a/packages/oidc-client/src/oidc.ts b/packages/oidc-client/src/oidc.ts
index 184257824..a9a98c644 100644
--- a/packages/oidc-client/src/oidc.ts
+++ b/packages/oidc-client/src/oidc.ts
@@ -316,7 +316,7 @@ Please checkout that you are using OIDC hook inside a ) => {
+ const listener = (e: MessageEvent) => {
if (e.origin === iFrameOrigin &&
e.source === iframe.contentWindow
) {
diff --git a/packages/react-oidc/src/core/routes/withRouter.tsx b/packages/react-oidc/src/core/routes/withRouter.tsx
index dd87edb1c..0a9769320 100644
--- a/packages/react-oidc/src/core/routes/withRouter.tsx
+++ b/packages/react-oidc/src/core/routes/withRouter.tsx
@@ -1,7 +1,7 @@
const generateKey = () =>
Math.random()
.toString(36)
- .substr(2, 6);
+ .slice(2, 8);
// Exported only for test
export type WindowInternal = Window & {
From f6cf194d9c14d7eba20f23a89e215bb9cc6cacd1 Mon Sep 17 00:00:00 2001
From: Jason Finch
Date: Sat, 13 Jul 2024 13:30:08 +1000
Subject: [PATCH 06/12] refactor(silentcallback): Catch any errors in async
playCallbackAsync
---
.../SilentCallback.component.tsx | 21 ++++++++++++-------
1 file changed, 14 insertions(+), 7 deletions(-)
diff --git a/packages/react-oidc/src/core/default-component/SilentCallback.component.tsx b/packages/react-oidc/src/core/default-component/SilentCallback.component.tsx
index 019110e6e..56709c298 100644
--- a/packages/react-oidc/src/core/default-component/SilentCallback.component.tsx
+++ b/packages/react-oidc/src/core/default-component/SilentCallback.component.tsx
@@ -1,17 +1,24 @@
import { OidcClient } from '@axa-fr/oidc-client';
-import { ComponentType, useEffect } from 'react';
+import { FC, useEffect } from 'react';
-const SilentCallbackManager: ComponentType = ({ configurationName }) => {
+export interface SilentCallbackProps {
+ configurationName: string;
+ }
+
+const SilentCallbackManager: FC = ({ configurationName }) => {
useEffect(() => {
const playCallbackAsync = async () => {
- const getOidc = OidcClient.get;
- const oidc = getOidc(configurationName);
+ const oidc = OidcClient.get(configurationName);
oidc.silentLoginCallbackAsync();
};
- playCallbackAsync();
- }, []);
- return <>>;
+ playCallbackAsync().catch(error => {
+ console.error('Error during silent login callback:', error);
+ });
+
+ }, [configurationName]);
+
+ return null;
};
export default SilentCallbackManager;
From a082b20a943ab6322e69c00770d8ba86c9b8eaa2 Mon Sep 17 00:00:00 2001
From: Jason Finch
Date: Wed, 17 Jul 2024 09:27:31 +1000
Subject: [PATCH 07/12] fix (Lint): Fix lint errors after rebase.
---
packages/oidc-client-service-worker/src/OidcServiceWorker.ts | 4 ++--
.../src/utils/__tests__/domains.spec.ts | 2 +-
.../src/utils/__tests__/testHelper.ts | 2 +-
packages/oidc-client/src/initWorker.ts | 4 ++--
4 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/packages/oidc-client-service-worker/src/OidcServiceWorker.ts b/packages/oidc-client-service-worker/src/OidcServiceWorker.ts
index 6e3ce4f71..b4ed59238 100644
--- a/packages/oidc-client-service-worker/src/OidcServiceWorker.ts
+++ b/packages/oidc-client-service-worker/src/OidcServiceWorker.ts
@@ -356,7 +356,7 @@ const handleMessage = async (event: ExtendableMessageEvent) => {
demonstratingProofOfPossessionJwkJson: null,
demonstratingProofOfPossessionConfiguration: null,
demonstratingProofOfPossessionOnlyWhenDpopHeaderPresent: false,
- allowMultiTabLogin: allowMultiTabLogin ?? false
+ allowMultiTabLogin: allowMultiTabLogin ?? false,
};
currentDatabase = database[configurationName];
@@ -500,7 +500,7 @@ const handleMessage = async (event: ExtendableMessageEvent) => {
return;
}
case 'getNonce': {
- const keyNonce = TOKEN.NONCE_TOKEN + '_' + configurationName + '_' + tabId
+ const keyNonce = TOKEN.NONCE_TOKEN + '_' + configurationName + '_' + tabId;
const nonce = currentDatabase.nonce ? keyNonce : null;
port.postMessage({ configurationName, nonce });
return;
diff --git a/packages/oidc-client-service-worker/src/utils/__tests__/domains.spec.ts b/packages/oidc-client-service-worker/src/utils/__tests__/domains.spec.ts
index 1b64601db..f265f69f3 100644
--- a/packages/oidc-client-service-worker/src/utils/__tests__/domains.spec.ts
+++ b/packages/oidc-client-service-worker/src/utils/__tests__/domains.spec.ts
@@ -56,7 +56,7 @@ describe('domains', () => {
demonstratingProofOfPossessionJwkJson: null,
demonstratingProofOfPossessionConfiguration: null,
demonstratingProofOfPossessionOnlyWhenDpopHeaderPresent: false,
- allowMultiTabLogin: true
+ allowMultiTabLogin: true,
},
};
});
diff --git a/packages/oidc-client-service-worker/src/utils/__tests__/testHelper.ts b/packages/oidc-client-service-worker/src/utils/__tests__/testHelper.ts
index 7d68ff316..4029eb6ab 100644
--- a/packages/oidc-client-service-worker/src/utils/__tests__/testHelper.ts
+++ b/packages/oidc-client-service-worker/src/utils/__tests__/testHelper.ts
@@ -130,7 +130,7 @@ class OidcConfigBuilder {
demonstratingProofOfPossessionJwkJson: null,
demonstratingProofOfPossessionConfiguration: null,
demonstratingProofOfPossessionOnlyWhenDpopHeaderPresent: false,
- allowMultiTabLogin: true
+ allowMultiTabLogin: true,
};
public withTestingDefault(): OidcConfigBuilder {
diff --git a/packages/oidc-client/src/initWorker.ts b/packages/oidc-client/src/initWorker.ts
index 80999d2b5..79b5f325b 100644
--- a/packages/oidc-client/src/initWorker.ts
+++ b/packages/oidc-client/src/initWorker.ts
@@ -75,7 +75,7 @@ export const initWorkerAsync = async(configuration, configurationName) => {
const newTabId = globalThis.crypto.randomUUID();
sessionStorage.setItem(`oidc.tabId.${configurationName}`, newTabId);
return newTabId;
- }
+ };
const serviceWorkerRelativeUrl = configuration.service_worker_relative_url;
if (typeof window === 'undefined' || typeof navigator === 'undefined' || !navigator.serviceWorker || !serviceWorkerRelativeUrl) {
@@ -116,7 +116,7 @@ export const initWorkerAsync = async(configuration, configurationName) => {
},
},
configurationName,
- tabId: getTabId()
+ tabId: getTabId(),
});
// @ts-ignore
From 9191b0c2f95491fd12cf93673bb468d9b6d61774 Mon Sep 17 00:00:00 2001
From: Jason Finch
Date: Wed, 17 Jul 2024 11:07:47 +1000
Subject: [PATCH 08/12] chore(packages): Bump packages for eslint/prettier
---
package.json | 12 +-
pnpm-lock.yaml | 364 ++++++++++++++++++++++++++++---------------------
2 files changed, 215 insertions(+), 161 deletions(-)
diff --git a/package.json b/package.json
index 8b42615f5..4a9e52dc3 100644
--- a/package.json
+++ b/package.json
@@ -28,9 +28,9 @@
},
"devDependencies": {
"@eslint/compat": "^1.1.1",
- "@typescript-eslint/eslint-plugin": "^7.16.0",
- "@typescript-eslint/parser": "^7.16.0",
- "eslint": "^9.6.0",
+ "@typescript-eslint/eslint-plugin": "^7.16.1",
+ "@typescript-eslint/parser": "^7.16.1",
+ "eslint": "^9.7.0",
"eslint-config-prettier": "^9.1.0",
"eslint-define-config": "^2.1.0",
"eslint-plugin-import": "^2.29.1",
@@ -38,13 +38,13 @@
"eslint-plugin-n": "^17.9.0",
"eslint-plugin-no-only-tests": "^3.1.0",
"eslint-plugin-prettier": "^5.1.3",
- "eslint-plugin-react": "^7.34.3",
+ "eslint-plugin-react": "^7.34.4",
"eslint-plugin-react-hooks": "^4.6.2",
"eslint-plugin-regexp": "^2.6.0",
"eslint-plugin-simple-import-sort": "^12.1.1",
"eslint-plugin-testing-library": "^6.2.2",
- "prettier": "^3.3.2",
- "tslib": "^2.6.2",
+ "prettier": "^3.3.3",
+ "tslib": "^2.6.3",
"tsx": "4.10.5",
"typescript": "5.4.5",
"vitest": "1.6.0"
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 83edb275f..d83a5560a 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -12,56 +12,56 @@ importers:
specifier: ^1.1.1
version: 1.1.1
'@typescript-eslint/eslint-plugin':
- specifier: ^7.16.0
- version: 7.16.0(@typescript-eslint/parser@7.16.0)(eslint@9.6.0)(typescript@5.4.5)
+ specifier: ^7.16.1
+ version: 7.16.1(@typescript-eslint/parser@7.16.1)(eslint@9.7.0)(typescript@5.4.5)
'@typescript-eslint/parser':
- specifier: ^7.16.0
- version: 7.16.0(eslint@9.6.0)(typescript@5.4.5)
+ specifier: ^7.16.1
+ version: 7.16.1(eslint@9.7.0)(typescript@5.4.5)
eslint:
- specifier: ^9.6.0
- version: 9.6.0
+ specifier: ^9.7.0
+ version: 9.7.0
eslint-config-prettier:
specifier: ^9.1.0
- version: 9.1.0(eslint@9.6.0)
+ version: 9.1.0(eslint@9.7.0)
eslint-define-config:
specifier: ^2.1.0
version: 2.1.0
eslint-plugin-import:
specifier: ^2.29.1
- version: 2.29.1(@typescript-eslint/parser@7.16.0)(eslint@9.6.0)
+ version: 2.29.1(@typescript-eslint/parser@7.16.1)(eslint@9.7.0)
eslint-plugin-jsx-a11y:
specifier: ^6.9.0
- version: 6.9.0(eslint@9.6.0)
+ version: 6.9.0(eslint@9.7.0)
eslint-plugin-n:
specifier: ^17.9.0
- version: 17.9.0(eslint@9.6.0)
+ version: 17.9.0(eslint@9.7.0)
eslint-plugin-no-only-tests:
specifier: ^3.1.0
version: 3.1.0
eslint-plugin-prettier:
specifier: ^5.1.3
- version: 5.1.3(eslint-config-prettier@9.1.0)(eslint@9.6.0)(prettier@3.3.2)
+ version: 5.1.3(eslint-config-prettier@9.1.0)(eslint@9.7.0)(prettier@3.3.3)
eslint-plugin-react:
- specifier: ^7.34.3
- version: 7.34.3(eslint@9.6.0)
+ specifier: ^7.34.4
+ version: 7.34.4(eslint@9.7.0)
eslint-plugin-react-hooks:
specifier: ^4.6.2
- version: 4.6.2(eslint@9.6.0)
+ version: 4.6.2(eslint@9.7.0)
eslint-plugin-regexp:
specifier: ^2.6.0
- version: 2.6.0(eslint@9.6.0)
+ version: 2.6.0(eslint@9.7.0)
eslint-plugin-simple-import-sort:
specifier: ^12.1.1
- version: 12.1.1(eslint@9.6.0)
+ version: 12.1.1(eslint@9.7.0)
eslint-plugin-testing-library:
specifier: ^6.2.2
- version: 6.2.2(eslint@9.6.0)(typescript@5.4.5)
+ version: 6.2.2(eslint@9.7.0)(typescript@5.4.5)
prettier:
- specifier: ^3.3.2
- version: 3.3.2
+ specifier: ^3.3.3
+ version: 3.3.3
tslib:
- specifier: ^2.6.2
- version: 2.6.2
+ specifier: ^2.6.3
+ version: 2.6.3
tsx:
specifier: 4.10.5
version: 4.10.5
@@ -97,7 +97,7 @@ importers:
version: 6.4.2(@types/jest@29.5.12)(vitest@1.6.0)
'@testing-library/user-event':
specifier: 14.5.2
- version: 14.5.2(@testing-library/dom@10.1.0)
+ version: 14.5.2(@testing-library/dom@10.3.2)
'@types/jest':
specifier: 29.5.12
version: 29.5.12
@@ -141,7 +141,7 @@ importers:
version: 15.0.7(@types/react@18.3.2)(react-dom@18.2.0)(react@18.2.0)
'@testing-library/user-event':
specifier: 14.5.2
- version: 14.5.2(@testing-library/dom@10.1.0)
+ version: 14.5.2(@testing-library/dom@10.3.2)
'@types/react':
specifier: 18.3.2
version: 18.3.2
@@ -257,7 +257,7 @@ importers:
version: 15.0.7(@types/react@18.3.2)(react-dom@18.3.1)(react@18.3.1)
'@testing-library/user-event':
specifier: 14.5.2
- version: 14.5.2(@testing-library/dom@10.1.0)
+ version: 14.5.2(@testing-library/dom@10.3.2)
'@types/react':
specifier: 18.3.2
version: 18.3.2
@@ -337,6 +337,13 @@ packages:
'@babel/highlight': 7.23.4
chalk: 2.4.2
+ /@babel/code-frame@7.24.7:
+ resolution: {integrity: sha512-BcYH1CVJBO9tvyIZ2jVeXgSIMvGZ2FDRvDdOIVQyuklNKSsx+eppDEBq/g47Ayw+RqNFE+URvOShmf+f/qwAlA==}
+ engines: {node: '>=6.9.0'}
+ dependencies:
+ '@babel/highlight': 7.24.7
+ picocolors: 1.0.1
+
/@babel/compat-data@7.23.5:
resolution: {integrity: sha512-uU27kfDRlhfKl+w1U6vp16IuvSLtjAxdArVXPa9BvLkrr7CYIsxH5adpHObeAGY/41+syctUWOZ140a2Rvkgjw==}
engines: {node: '>=6.9.0'}
@@ -455,6 +462,10 @@ packages:
resolution: {integrity: sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==}
engines: {node: '>=6.9.0'}
+ /@babel/helper-validator-identifier@7.24.7:
+ resolution: {integrity: sha512-rR+PBcQ1SMQDDyF6X0wxtG8QyLCgUB0eRAGguqRLfkCA87l7yAP7ehq8SNj96OOGTO8OBV70KhuFYcIkHXOg0w==}
+ engines: {node: '>=6.9.0'}
+
/@babel/helper-validator-option@7.23.5:
resolution: {integrity: sha512-85ttAOMLsr53VgXkTbkx8oA6YTfT4q7/HzXSLEYmjcSTJPMPQtvq1BD79Byep5xMUYbGRzEpDsjUf3dyp54IKw==}
engines: {node: '>=6.9.0'}
@@ -479,6 +490,15 @@ packages:
chalk: 2.4.2
js-tokens: 4.0.0
+ /@babel/highlight@7.24.7:
+ resolution: {integrity: sha512-EStJpq4OuY8xYfhGVXngigBJRWxftKX9ksiGDnmlY3o7B/V7KIAc9X4oiK87uPJSc/vs5L869bem5fhZa8caZw==}
+ engines: {node: '>=6.9.0'}
+ dependencies:
+ '@babel/helper-validator-identifier': 7.24.7
+ chalk: 2.4.2
+ js-tokens: 4.0.0
+ picocolors: 1.0.1
+
/@babel/parser@7.23.9:
resolution: {integrity: sha512-9tcKgqKbs3xGJ+NtKF2ndOBBLVwPjl1SHxPQkd36r3Dlirw3xWUeGaTbqr7uGZcTaxkVNwc+03SVP7aCdWrTlA==}
engines: {node: '>=6.0.0'}
@@ -513,6 +533,12 @@ packages:
dependencies:
regenerator-runtime: 0.14.1
+ /@babel/runtime@7.24.8:
+ resolution: {integrity: sha512-5F7SDGs1T72ZczbRwbGO9lQi0NLjQxzl6i4lJxLxfW9U5UluCSyEJeniWvnhl3/euNiqQVbo8zruhsDfid0esA==}
+ engines: {node: '>=6.9.0'}
+ dependencies:
+ regenerator-runtime: 0.14.1
+
/@babel/template@7.23.9:
resolution: {integrity: sha512-+xrD2BWLpvHKNmX2QbpdpsBaWnRxahMwJjO+KZk2JOElj5nSmKezyS1B4u+QbHMTX69t4ukm6hh9lsYQ7GHCKA==}
engines: {node: '>=6.9.0'}
@@ -956,13 +982,13 @@ packages:
requiresBuild: true
optional: true
- /@eslint-community/eslint-utils@4.4.0(eslint@9.6.0):
+ /@eslint-community/eslint-utils@4.4.0(eslint@9.7.0):
resolution: {integrity: sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
peerDependencies:
eslint: ^6.0.0 || ^7.0.0 || >=8.0.0
dependencies:
- eslint: 9.6.0
+ eslint: 9.7.0
eslint-visitor-keys: 3.4.3
dev: true
@@ -971,6 +997,11 @@ packages:
engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0}
dev: true
+ /@eslint-community/regexpp@4.11.0:
+ resolution: {integrity: sha512-G/M/tIiMrTAxEWRfLfQJMmGNX28IxBg4PBz8XqQhqUHLFI6TL2htpIB1iQCj144V5ee/JaKyT9/WZ0MGZWfA7A==}
+ engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0}
+ dev: true
+
/@eslint/compat@1.1.1:
resolution: {integrity: sha512-lpHyRyplhGPL5mGEh6M9O5nnKk0Gz4bFI+Zu6tKlPpDUN7XshWvH9C/px4UVm87IAANE0W81CEsNGbS1KlzXpA==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
@@ -1004,8 +1035,8 @@ packages:
- supports-color
dev: true
- /@eslint/js@9.6.0:
- resolution: {integrity: sha512-D9B0/3vNg44ZeWbYMpBoXqNP4j6eQD5vNwIlGAuFRRzK/WtT/jvDQW3Bi9kkf3PMDMlM7Yi+73VLUsn5bJcl8A==}
+ /@eslint/js@9.7.0:
+ resolution: {integrity: sha512-ChuWDQenef8OSFnvuxv0TCVxEwmu3+hPNKvM9B34qpM0rDRbjL8t5QkQeHHeAfsKQjuH9wS82WeCi1J/owatng==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
dev: true
@@ -1642,6 +1673,20 @@ packages:
dom-accessibility-api: 0.5.16
lz-string: 1.5.0
pretty-format: 27.5.1
+ dev: true
+
+ /@testing-library/dom@10.3.2:
+ resolution: {integrity: sha512-0bxIdP9mmPiOJ6wHLj8bdJRq+51oddObeCGdEf6PNEhYd93ZYAN+lPRnEOVFtheVwDM7+p+tza3LAQgp0PTudg==}
+ engines: {node: '>=18'}
+ dependencies:
+ '@babel/code-frame': 7.24.7
+ '@babel/runtime': 7.24.8
+ '@types/aria-query': 5.0.4
+ aria-query: 5.3.0
+ chalk: 4.1.2
+ dom-accessibility-api: 0.5.16
+ lz-string: 1.5.0
+ pretty-format: 27.5.1
/@testing-library/jest-dom@6.4.2(@types/jest@29.5.12)(vitest@1.6.0):
resolution: {integrity: sha512-CzqH0AFymEMG48CpzXFriYYkOjk6ZGPCLMhW9e9jg3KMCn5OfJecF8GtGW7yGfR/IgCe3SX8BSwjdzI6BBbZLw==}
@@ -1746,13 +1791,13 @@ packages:
react-dom: 18.3.1(react@18.3.1)
dev: true
- /@testing-library/user-event@14.5.2(@testing-library/dom@10.1.0):
+ /@testing-library/user-event@14.5.2(@testing-library/dom@10.3.2):
resolution: {integrity: sha512-YAh82Wh4TIrxYLmfGcixwD18oIjyC1pFQC2Y01F2lzV2HTMiYrI0nze0FD0ocB//CKS/7jIUgae+adPqxK5yCQ==}
engines: {node: '>=12', npm: '>=6'}
peerDependencies:
'@testing-library/dom': '>=7.21.4'
dependencies:
- '@testing-library/dom': 10.1.0
+ '@testing-library/dom': 10.3.2
/@types/argparse@1.0.38:
resolution: {integrity: sha512-ebDJ9b0e702Yr7pWgB0jzm+CX4Srzz8RcXtLJDJB+BSccqMa36uyH/zUsSYao5+BD1ytv3k3rPYCq4mAE1hsXA==}
@@ -1888,8 +1933,8 @@ packages:
'@types/yargs-parser': 21.0.3
dev: false
- /@typescript-eslint/eslint-plugin@7.16.0(@typescript-eslint/parser@7.16.0)(eslint@9.6.0)(typescript@5.4.5):
- resolution: {integrity: sha512-py1miT6iQpJcs1BiJjm54AMzeuMPBSPuKPlnT8HlfudbcS5rYeX5jajpLf3mrdRh9dA/Ec2FVUY0ifeVNDIhZw==}
+ /@typescript-eslint/eslint-plugin@7.16.1(@typescript-eslint/parser@7.16.1)(eslint@9.7.0)(typescript@5.4.5):
+ resolution: {integrity: sha512-SxdPak/5bO0EnGktV05+Hq8oatjAYVY3Zh2bye9pGZy6+jwyR3LG3YKkV4YatlsgqXP28BTeVm9pqwJM96vf2A==}
engines: {node: ^18.18.0 || >=20.0.0}
peerDependencies:
'@typescript-eslint/parser': ^7.0.0
@@ -1900,12 +1945,12 @@ packages:
optional: true
dependencies:
'@eslint-community/regexpp': 4.10.0
- '@typescript-eslint/parser': 7.16.0(eslint@9.6.0)(typescript@5.4.5)
- '@typescript-eslint/scope-manager': 7.16.0
- '@typescript-eslint/type-utils': 7.16.0(eslint@9.6.0)(typescript@5.4.5)
- '@typescript-eslint/utils': 7.16.0(eslint@9.6.0)(typescript@5.4.5)
- '@typescript-eslint/visitor-keys': 7.16.0
- eslint: 9.6.0
+ '@typescript-eslint/parser': 7.16.1(eslint@9.7.0)(typescript@5.4.5)
+ '@typescript-eslint/scope-manager': 7.16.1
+ '@typescript-eslint/type-utils': 7.16.1(eslint@9.7.0)(typescript@5.4.5)
+ '@typescript-eslint/utils': 7.16.1(eslint@9.7.0)(typescript@5.4.5)
+ '@typescript-eslint/visitor-keys': 7.16.1
+ eslint: 9.7.0
graphemer: 1.4.0
ignore: 5.3.1
natural-compare: 1.4.0
@@ -1915,8 +1960,8 @@ packages:
- supports-color
dev: true
- /@typescript-eslint/parser@7.16.0(eslint@9.6.0)(typescript@5.4.5):
- resolution: {integrity: sha512-ar9E+k7CU8rWi2e5ErzQiC93KKEFAXA2Kky0scAlPcxYblLt8+XZuHUZwlyfXILyQa95P6lQg+eZgh/dDs3+Vw==}
+ /@typescript-eslint/parser@7.16.1(eslint@9.7.0)(typescript@5.4.5):
+ resolution: {integrity: sha512-u+1Qx86jfGQ5i4JjK33/FnawZRpsLxRnKzGE6EABZ40KxVT/vWsiZFEBBHjFOljmmV3MBYOHEKi0Jm9hbAOClA==}
engines: {node: ^18.18.0 || >=20.0.0}
peerDependencies:
eslint: ^8.56.0
@@ -1925,12 +1970,12 @@ packages:
typescript:
optional: true
dependencies:
- '@typescript-eslint/scope-manager': 7.16.0
- '@typescript-eslint/types': 7.16.0
- '@typescript-eslint/typescript-estree': 7.16.0(typescript@5.4.5)
- '@typescript-eslint/visitor-keys': 7.16.0
+ '@typescript-eslint/scope-manager': 7.16.1
+ '@typescript-eslint/types': 7.16.1
+ '@typescript-eslint/typescript-estree': 7.16.1(typescript@5.4.5)
+ '@typescript-eslint/visitor-keys': 7.16.1
debug: 4.3.5
- eslint: 9.6.0
+ eslint: 9.7.0
typescript: 5.4.5
transitivePeerDependencies:
- supports-color
@@ -1944,16 +1989,16 @@ packages:
'@typescript-eslint/visitor-keys': 5.62.0
dev: true
- /@typescript-eslint/scope-manager@7.16.0:
- resolution: {integrity: sha512-8gVv3kW6n01Q6TrI1cmTZ9YMFi3ucDT7i7aI5lEikk2ebk1AEjrwX8MDTdaX5D7fPXMBLvnsaa0IFTAu+jcfOw==}
+ /@typescript-eslint/scope-manager@7.16.1:
+ resolution: {integrity: sha512-nYpyv6ALte18gbMz323RM+vpFpTjfNdyakbf3nsLvF43uF9KeNC289SUEW3QLZ1xPtyINJ1dIsZOuWuSRIWygw==}
engines: {node: ^18.18.0 || >=20.0.0}
dependencies:
- '@typescript-eslint/types': 7.16.0
- '@typescript-eslint/visitor-keys': 7.16.0
+ '@typescript-eslint/types': 7.16.1
+ '@typescript-eslint/visitor-keys': 7.16.1
dev: true
- /@typescript-eslint/type-utils@7.16.0(eslint@9.6.0)(typescript@5.4.5):
- resolution: {integrity: sha512-j0fuUswUjDHfqV/UdW6mLtOQQseORqfdmoBNDFOqs9rvNVR2e+cmu6zJu/Ku4SDuqiJko6YnhwcL8x45r8Oqxg==}
+ /@typescript-eslint/type-utils@7.16.1(eslint@9.7.0)(typescript@5.4.5):
+ resolution: {integrity: sha512-rbu/H2MWXN4SkjIIyWcmYBjlp55VT+1G3duFOIukTNFxr9PI35pLc2ydwAfejCEitCv4uztA07q0QWanOHC7dA==}
engines: {node: ^18.18.0 || >=20.0.0}
peerDependencies:
eslint: ^8.56.0
@@ -1962,10 +2007,10 @@ packages:
typescript:
optional: true
dependencies:
- '@typescript-eslint/typescript-estree': 7.16.0(typescript@5.4.5)
- '@typescript-eslint/utils': 7.16.0(eslint@9.6.0)(typescript@5.4.5)
+ '@typescript-eslint/typescript-estree': 7.16.1(typescript@5.4.5)
+ '@typescript-eslint/utils': 7.16.1(eslint@9.7.0)(typescript@5.4.5)
debug: 4.3.5
- eslint: 9.6.0
+ eslint: 9.7.0
ts-api-utils: 1.3.0(typescript@5.4.5)
typescript: 5.4.5
transitivePeerDependencies:
@@ -1977,8 +2022,8 @@ packages:
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
dev: true
- /@typescript-eslint/types@7.16.0:
- resolution: {integrity: sha512-fecuH15Y+TzlUutvUl9Cc2XJxqdLr7+93SQIbcZfd4XRGGKoxyljK27b+kxKamjRkU7FYC6RrbSCg0ALcZn/xw==}
+ /@typescript-eslint/types@7.16.1:
+ resolution: {integrity: sha512-AQn9XqCzUXd4bAVEsAXM/Izk11Wx2u4H3BAfQVhSfzfDOm/wAON9nP7J5rpkCxts7E5TELmN845xTUCQrD1xIQ==}
engines: {node: ^18.18.0 || >=20.0.0}
dev: true
@@ -1996,15 +2041,15 @@ packages:
debug: 4.3.5
globby: 11.1.0
is-glob: 4.0.3
- semver: 7.6.2
+ semver: 7.6.3
tsutils: 3.21.0(typescript@5.4.5)
typescript: 5.4.5
transitivePeerDependencies:
- supports-color
dev: true
- /@typescript-eslint/typescript-estree@7.16.0(typescript@5.4.5):
- resolution: {integrity: sha512-a5NTvk51ZndFuOLCh5OaJBELYc2O3Zqxfl3Js78VFE1zE46J2AaVuW+rEbVkQznjkmlzWsUI15BG5tQMixzZLw==}
+ /@typescript-eslint/typescript-estree@7.16.1(typescript@5.4.5):
+ resolution: {integrity: sha512-0vFPk8tMjj6apaAZ1HlwM8w7jbghC8jc1aRNJG5vN8Ym5miyhTQGMqU++kuBFDNKe9NcPeZ6x0zfSzV8xC1UlQ==}
engines: {node: ^18.18.0 || >=20.0.0}
peerDependencies:
typescript: '*'
@@ -2012,50 +2057,50 @@ packages:
typescript:
optional: true
dependencies:
- '@typescript-eslint/types': 7.16.0
- '@typescript-eslint/visitor-keys': 7.16.0
+ '@typescript-eslint/types': 7.16.1
+ '@typescript-eslint/visitor-keys': 7.16.1
debug: 4.3.5
globby: 11.1.0
is-glob: 4.0.3
minimatch: 9.0.5
- semver: 7.6.2
+ semver: 7.6.3
ts-api-utils: 1.3.0(typescript@5.4.5)
typescript: 5.4.5
transitivePeerDependencies:
- supports-color
dev: true
- /@typescript-eslint/utils@5.62.0(eslint@9.6.0)(typescript@5.4.5):
+ /@typescript-eslint/utils@5.62.0(eslint@9.7.0)(typescript@5.4.5):
resolution: {integrity: sha512-n8oxjeb5aIbPFEtmQxQYOLI0i9n5ySBEY/ZEHHZqKQSFnxio1rv6dthascc9dLuwrL0RC5mPCxB7vnAVGAYWAQ==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
peerDependencies:
eslint: ^6.0.0 || ^7.0.0 || ^8.0.0
dependencies:
- '@eslint-community/eslint-utils': 4.4.0(eslint@9.6.0)
+ '@eslint-community/eslint-utils': 4.4.0(eslint@9.7.0)
'@types/json-schema': 7.0.15
'@types/semver': 7.5.6
'@typescript-eslint/scope-manager': 5.62.0
'@typescript-eslint/types': 5.62.0
'@typescript-eslint/typescript-estree': 5.62.0(typescript@5.4.5)
- eslint: 9.6.0
+ eslint: 9.7.0
eslint-scope: 5.1.1
- semver: 7.6.2
+ semver: 7.6.3
transitivePeerDependencies:
- supports-color
- typescript
dev: true
- /@typescript-eslint/utils@7.16.0(eslint@9.6.0)(typescript@5.4.5):
- resolution: {integrity: sha512-PqP4kP3hb4r7Jav+NiRCntlVzhxBNWq6ZQ+zQwII1y/G/1gdIPeYDCKr2+dH6049yJQsWZiHU6RlwvIFBXXGNA==}
+ /@typescript-eslint/utils@7.16.1(eslint@9.7.0)(typescript@5.4.5):
+ resolution: {integrity: sha512-WrFM8nzCowV0he0RlkotGDujx78xudsxnGMBHI88l5J8wEhED6yBwaSLP99ygfrzAjsQvcYQ94quDwI0d7E1fA==}
engines: {node: ^18.18.0 || >=20.0.0}
peerDependencies:
eslint: ^8.56.0
dependencies:
- '@eslint-community/eslint-utils': 4.4.0(eslint@9.6.0)
- '@typescript-eslint/scope-manager': 7.16.0
- '@typescript-eslint/types': 7.16.0
- '@typescript-eslint/typescript-estree': 7.16.0(typescript@5.4.5)
- eslint: 9.6.0
+ '@eslint-community/eslint-utils': 4.4.0(eslint@9.7.0)
+ '@typescript-eslint/scope-manager': 7.16.1
+ '@typescript-eslint/types': 7.16.1
+ '@typescript-eslint/typescript-estree': 7.16.1(typescript@5.4.5)
+ eslint: 9.7.0
transitivePeerDependencies:
- supports-color
- typescript
@@ -2069,11 +2114,11 @@ packages:
eslint-visitor-keys: 3.4.3
dev: true
- /@typescript-eslint/visitor-keys@7.16.0:
- resolution: {integrity: sha512-rMo01uPy9C7XxG7AFsxa8zLnWXTF8N3PYclekWSrurvhwiw1eW88mrKiAYe6s53AUY57nTRz8dJsuuXdkAhzCg==}
+ /@typescript-eslint/visitor-keys@7.16.1:
+ resolution: {integrity: sha512-Qlzzx4sE4u3FsHTPQAAQFJFNOuqtuY0LFrZHwQ8IHK705XxBiWOFkfKRWu6niB7hwfgnwIpO4jTC75ozW1PHWg==}
engines: {node: ^18.18.0 || >=20.0.0}
dependencies:
- '@typescript-eslint/types': 7.16.0
+ '@typescript-eslint/types': 7.16.1
eslint-visitor-keys: 3.4.3
dev: true
@@ -2501,18 +2546,18 @@ packages:
balanced-match: 1.0.2
dev: true
- /braces@3.0.2:
- resolution: {integrity: sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==}
+ /braces@3.0.3:
+ resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==}
engines: {node: '>=8'}
dependencies:
- fill-range: 7.0.1
+ fill-range: 7.1.1
/browserslist@4.22.3:
resolution: {integrity: sha512-UAp55yfwNv0klWNapjs/ktHoguxuQNGnOzxYmfnXIS+8AsRDZkSDxg7R1AX3GKzn078SBI5dzwzj/Yx0Or0e3A==}
engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7}
hasBin: true
dependencies:
- caniuse-lite: 1.0.30001641
+ caniuse-lite: 1.0.30001642
electron-to-chromium: 1.4.657
node-releases: 2.0.14
update-browserslist-db: 1.0.13(browserslist@4.22.3)
@@ -2545,8 +2590,8 @@ packages:
engines: {node: '>=6'}
dev: true
- /caniuse-lite@1.0.30001641:
- resolution: {integrity: sha512-Phv5thgl67bHYo1TtMY/MurjkHhV4EDaCosezRXgZ8jzA/Ub+wjxAvbGvjoFENStinwi5kCyOYV3mi5tOGykwA==}
+ /caniuse-lite@1.0.30001642:
+ resolution: {integrity: sha512-3XQ0DoRgLijXJErLSl+bLnJ+Et4KqV1PY6JJBGAFlsNsz31zeAIncyeZfLCabHK/jtSh+671RM9YMldxjUPZtA==}
/chai@4.4.1:
resolution: {integrity: sha512-13sOfMv2+DWduEU+/xbun3LScLoqN17nBeTLUsmDfKdoiC1fr0n9PU4guu4AhRcOVFk/sW8LyZWHuhWtQZiF+g==}
@@ -2734,7 +2779,7 @@ packages:
cp-file: 10.0.0
globby: 13.2.2
junk: 4.0.1
- micromatch: 4.0.5
+ micromatch: 4.0.7
nested-error-stacks: 2.1.1
p-filter: 3.0.0
p-map: 6.0.0
@@ -3195,22 +3240,22 @@ packages:
engines: {node: '>=12'}
dev: true
- /eslint-compat-utils@0.1.2(eslint@9.6.0):
+ /eslint-compat-utils@0.1.2(eslint@9.7.0):
resolution: {integrity: sha512-Jia4JDldWnFNIru1Ehx1H5s9/yxiRHY/TimCuUc0jNexew3cF1gI6CYZil1ociakfWO3rRqFjl1mskBblB3RYg==}
engines: {node: '>=12'}
peerDependencies:
eslint: '>=6.0.0'
dependencies:
- eslint: 9.6.0
+ eslint: 9.7.0
dev: true
- /eslint-config-prettier@9.1.0(eslint@9.6.0):
+ /eslint-config-prettier@9.1.0(eslint@9.7.0):
resolution: {integrity: sha512-NSWl5BFQWEPi1j4TjVNItzYV7dZXZ+wP6I6ZhrBGpChQhZRUaElihE9uRRkcbRnNb76UMKDF3r+WTmNcGPKsqw==}
hasBin: true
peerDependencies:
eslint: '>=7.0.0'
dependencies:
- eslint: 9.6.0
+ eslint: 9.7.0
dev: true
/eslint-define-config@2.1.0:
@@ -3228,7 +3273,7 @@ packages:
- supports-color
dev: true
- /eslint-module-utils@2.8.0(@typescript-eslint/parser@7.16.0)(eslint-import-resolver-node@0.3.9)(eslint@9.6.0):
+ /eslint-module-utils@2.8.0(@typescript-eslint/parser@7.16.1)(eslint-import-resolver-node@0.3.9)(eslint@9.7.0):
resolution: {integrity: sha512-aWajIYfsqCKRDgUfjEXNN/JlrzauMuSEy5sbd7WXbtW3EH6A6MpwEh42c7qD+MqQo9QMJ6fWLAeIJynx0g6OAw==}
engines: {node: '>=4'}
peerDependencies:
@@ -3249,27 +3294,27 @@ packages:
eslint-import-resolver-webpack:
optional: true
dependencies:
- '@typescript-eslint/parser': 7.16.0(eslint@9.6.0)(typescript@5.4.5)
+ '@typescript-eslint/parser': 7.16.1(eslint@9.7.0)(typescript@5.4.5)
debug: 3.2.7
- eslint: 9.6.0
+ eslint: 9.7.0
eslint-import-resolver-node: 0.3.9
transitivePeerDependencies:
- supports-color
dev: true
- /eslint-plugin-es-x@7.5.0(eslint@9.6.0):
+ /eslint-plugin-es-x@7.5.0(eslint@9.7.0):
resolution: {integrity: sha512-ODswlDSO0HJDzXU0XvgZ3lF3lS3XAZEossh15Q2UHjwrJggWeBoKqqEsLTZLXl+dh5eOAozG0zRcYtuE35oTuQ==}
engines: {node: ^14.18.0 || >=16.0.0}
peerDependencies:
eslint: '>=8'
dependencies:
- '@eslint-community/eslint-utils': 4.4.0(eslint@9.6.0)
- '@eslint-community/regexpp': 4.10.0
- eslint: 9.6.0
- eslint-compat-utils: 0.1.2(eslint@9.6.0)
+ '@eslint-community/eslint-utils': 4.4.0(eslint@9.7.0)
+ '@eslint-community/regexpp': 4.11.0
+ eslint: 9.7.0
+ eslint-compat-utils: 0.1.2(eslint@9.7.0)
dev: true
- /eslint-plugin-import@2.29.1(@typescript-eslint/parser@7.16.0)(eslint@9.6.0):
+ /eslint-plugin-import@2.29.1(@typescript-eslint/parser@7.16.1)(eslint@9.7.0):
resolution: {integrity: sha512-BbPC0cuExzhiMo4Ff1BTVwHpjjv28C5R+btTOGaCRC7UEz801up0JadwkeSk5Ued6TG34uaczuVuH6qyy5YUxw==}
engines: {node: '>=4'}
peerDependencies:
@@ -3279,16 +3324,16 @@ packages:
'@typescript-eslint/parser':
optional: true
dependencies:
- '@typescript-eslint/parser': 7.16.0(eslint@9.6.0)(typescript@5.4.5)
+ '@typescript-eslint/parser': 7.16.1(eslint@9.7.0)(typescript@5.4.5)
array-includes: 3.1.8
array.prototype.findlastindex: 1.2.3
array.prototype.flat: 1.3.2
array.prototype.flatmap: 1.3.2
debug: 3.2.7
doctrine: 2.1.0
- eslint: 9.6.0
+ eslint: 9.7.0
eslint-import-resolver-node: 0.3.9
- eslint-module-utils: 2.8.0(@typescript-eslint/parser@7.16.0)(eslint-import-resolver-node@0.3.9)(eslint@9.6.0)
+ eslint-module-utils: 2.8.0(@typescript-eslint/parser@7.16.1)(eslint-import-resolver-node@0.3.9)(eslint@9.7.0)
hasown: 2.0.2
is-core-module: 2.14.0
is-glob: 4.0.3
@@ -3304,7 +3349,7 @@ packages:
- supports-color
dev: true
- /eslint-plugin-jsx-a11y@6.9.0(eslint@9.6.0):
+ /eslint-plugin-jsx-a11y@6.9.0(eslint@9.7.0):
resolution: {integrity: sha512-nOFOCaJG2pYqORjK19lqPqxMO/JpvdCZdPtNdxY3kvom3jTvkAbOvQvD8wuD0G8BYR0IGAGYDlzqWJOh/ybn2g==}
engines: {node: '>=4.0'}
peerDependencies:
@@ -3319,7 +3364,7 @@ packages:
damerau-levenshtein: 1.0.8
emoji-regex: 9.2.2
es-iterator-helpers: 1.0.19
- eslint: 9.6.0
+ eslint: 9.7.0
hasown: 2.0.2
jsx-ast-utils: 3.3.5
language-tags: 1.0.9
@@ -3329,16 +3374,16 @@ packages:
string.prototype.includes: 2.0.0
dev: true
- /eslint-plugin-n@17.9.0(eslint@9.6.0):
+ /eslint-plugin-n@17.9.0(eslint@9.7.0):
resolution: {integrity: sha512-CPSaXDXdrT4nsrOrO4mT4VB6FMUkoySRkHWuuJJHVqsIEjIeZgMY1H7AzSwPbDScikBmLN82KeM1u7ixV7PzGg==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
peerDependencies:
eslint: '>=8.23.0'
dependencies:
- '@eslint-community/eslint-utils': 4.4.0(eslint@9.6.0)
+ '@eslint-community/eslint-utils': 4.4.0(eslint@9.7.0)
enhanced-resolve: 5.17.0
- eslint: 9.6.0
- eslint-plugin-es-x: 7.5.0(eslint@9.6.0)
+ eslint: 9.7.0
+ eslint-plugin-es-x: 7.5.0(eslint@9.7.0)
get-tsconfig: 4.7.5
globals: 15.2.0
ignore: 5.3.1
@@ -3351,7 +3396,7 @@ packages:
engines: {node: '>=5.0.0'}
dev: true
- /eslint-plugin-prettier@5.1.3(eslint-config-prettier@9.1.0)(eslint@9.6.0)(prettier@3.3.2):
+ /eslint-plugin-prettier@5.1.3(eslint-config-prettier@9.1.0)(eslint@9.7.0)(prettier@3.3.3):
resolution: {integrity: sha512-C9GCVAs4Eq7ZC/XFQHITLiHJxQngdtraXaM+LoUFoFp/lHNl2Zn8f3WQbe9HvTBBQ9YnKFB0/2Ajdqwo5D1EAw==}
engines: {node: ^14.18.0 || >=16.0.0}
peerDependencies:
@@ -3365,24 +3410,24 @@ packages:
eslint-config-prettier:
optional: true
dependencies:
- eslint: 9.6.0
- eslint-config-prettier: 9.1.0(eslint@9.6.0)
- prettier: 3.3.2
+ eslint: 9.7.0
+ eslint-config-prettier: 9.1.0(eslint@9.7.0)
+ prettier: 3.3.3
prettier-linter-helpers: 1.0.0
synckit: 0.8.8
dev: true
- /eslint-plugin-react-hooks@4.6.2(eslint@9.6.0):
+ /eslint-plugin-react-hooks@4.6.2(eslint@9.7.0):
resolution: {integrity: sha512-QzliNJq4GinDBcD8gPB5v0wh6g8q3SUi6EFF0x8N/BL9PoVs0atuGc47ozMRyOWAKdwaZ5OnbOEa3WR+dSGKuQ==}
engines: {node: '>=10'}
peerDependencies:
eslint: ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0
dependencies:
- eslint: 9.6.0
+ eslint: 9.7.0
dev: true
- /eslint-plugin-react@7.34.3(eslint@9.6.0):
- resolution: {integrity: sha512-aoW4MV891jkUulwDApQbPYTVZmeuSyFrudpbTAQuj5Fv8VL+o6df2xIGpw8B0hPjAaih1/Fb0om9grCdyFYemA==}
+ /eslint-plugin-react@7.34.4(eslint@9.7.0):
+ resolution: {integrity: sha512-Np+jo9bUwJNxCsT12pXtrGhJgT3T44T1sHhn1Ssr42XFn8TES0267wPGo5nNrMHi8qkyimDAX2BUmkf9pSaVzA==}
engines: {node: '>=4'}
peerDependencies:
eslint: ^3 || ^4 || ^5 || ^6 || ^7 || ^8
@@ -3394,52 +3439,53 @@ packages:
array.prototype.tosorted: 1.1.4
doctrine: 2.1.0
es-iterator-helpers: 1.0.19
- eslint: 9.6.0
+ eslint: 9.7.0
estraverse: 5.3.0
+ hasown: 2.0.2
jsx-ast-utils: 3.3.5
minimatch: 3.1.2
object.entries: 1.1.8
object.fromentries: 2.0.8
- object.hasown: 1.1.4
object.values: 1.2.0
prop-types: 15.8.1
resolve: 2.0.0-next.5
semver: 6.3.1
string.prototype.matchall: 4.0.11
+ string.prototype.repeat: 1.0.0
dev: true
- /eslint-plugin-regexp@2.6.0(eslint@9.6.0):
+ /eslint-plugin-regexp@2.6.0(eslint@9.7.0):
resolution: {integrity: sha512-FCL851+kislsTEQEMioAlpDuK5+E5vs0hi1bF8cFlPlHcEjeRhuAzEsGikXRreE+0j4WhW2uO54MqTjXtYOi3A==}
engines: {node: ^18 || >=20}
peerDependencies:
eslint: '>=8.44.0'
dependencies:
- '@eslint-community/eslint-utils': 4.4.0(eslint@9.6.0)
+ '@eslint-community/eslint-utils': 4.4.0(eslint@9.7.0)
'@eslint-community/regexpp': 4.10.0
comment-parser: 1.4.1
- eslint: 9.6.0
+ eslint: 9.7.0
jsdoc-type-pratt-parser: 4.0.0
refa: 0.12.1
regexp-ast-analysis: 0.7.1
scslre: 0.3.0
dev: true
- /eslint-plugin-simple-import-sort@12.1.1(eslint@9.6.0):
+ /eslint-plugin-simple-import-sort@12.1.1(eslint@9.7.0):
resolution: {integrity: sha512-6nuzu4xwQtE3332Uz0to+TxDQYRLTKRESSc2hefVT48Zc8JthmN23Gx9lnYhu0FtkRSL1oxny3kJ2aveVhmOVA==}
peerDependencies:
eslint: '>=5.0.0'
dependencies:
- eslint: 9.6.0
+ eslint: 9.7.0
dev: true
- /eslint-plugin-testing-library@6.2.2(eslint@9.6.0)(typescript@5.4.5):
+ /eslint-plugin-testing-library@6.2.2(eslint@9.7.0)(typescript@5.4.5):
resolution: {integrity: sha512-1E94YOTUDnOjSLyvOwmbVDzQi/WkKm3WVrMXu6SmBr6DN95xTGZmI6HJ/eOkSXh/DlheRsxaPsJvZByDBhWLVQ==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0, npm: '>=6'}
peerDependencies:
eslint: ^7.5.0 || ^8.0.0
dependencies:
- '@typescript-eslint/utils': 5.62.0(eslint@9.6.0)(typescript@5.4.5)
- eslint: 9.6.0
+ '@typescript-eslint/utils': 5.62.0(eslint@9.7.0)(typescript@5.4.5)
+ eslint: 9.7.0
transitivePeerDependencies:
- supports-color
- typescript
@@ -3453,8 +3499,8 @@ packages:
estraverse: 4.3.0
dev: true
- /eslint-scope@8.0.1:
- resolution: {integrity: sha512-pL8XjgP4ZOmmwfFE8mEhSxA7ZY4C+LWyqjQ3o4yWkkmD0qcMT9kkW3zWHOczhWcjTSgqycYAgwSlXvZltv65og==}
+ /eslint-scope@8.0.2:
+ resolution: {integrity: sha512-6E4xmrTw5wtxnLA5wYL3WDfhZ/1bUBGOXV0zQvVRDOtrR8D0p6W7fs3JweNYhwRYeGvd/1CKX2se0/2s7Q/nJA==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
dependencies:
esrecurse: 4.3.0
@@ -3471,16 +3517,16 @@ packages:
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
dev: true
- /eslint@9.6.0:
- resolution: {integrity: sha512-ElQkdLMEEqQNM9Njff+2Y4q2afHk7JpkPvrd7Xh7xefwgQynqPxwf55J7di9+MEibWUGdNjFF9ITG9Pck5M84w==}
+ /eslint@9.7.0:
+ resolution: {integrity: sha512-FzJ9D/0nGiCGBf8UXO/IGLTgLVzIxze1zpfA8Ton2mjLovXdAPlYDv+MQDcqj3TmrhAGYfOpz9RfR+ent0AgAw==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
hasBin: true
dependencies:
- '@eslint-community/eslint-utils': 4.4.0(eslint@9.6.0)
- '@eslint-community/regexpp': 4.10.0
+ '@eslint-community/eslint-utils': 4.4.0(eslint@9.7.0)
+ '@eslint-community/regexpp': 4.11.0
'@eslint/config-array': 0.17.0
'@eslint/eslintrc': 3.1.0
- '@eslint/js': 9.6.0
+ '@eslint/js': 9.7.0
'@humanwhocodes/module-importer': 1.0.1
'@humanwhocodes/retry': 0.3.0
'@nodelib/fs.walk': 1.2.8
@@ -3489,7 +3535,7 @@ packages:
cross-spawn: 7.0.3
debug: 4.3.5
escape-string-regexp: 4.0.0
- eslint-scope: 8.0.1
+ eslint-scope: 8.0.2
eslint-visitor-keys: 4.0.0
espree: 10.1.0
esquery: 1.5.0
@@ -3602,7 +3648,7 @@ packages:
'@nodelib/fs.walk': 1.2.8
glob-parent: 5.1.2
merge2: 1.4.1
- micromatch: 4.0.5
+ micromatch: 4.0.7
dev: true
/fast-json-stable-stringify@2.1.0:
@@ -3626,8 +3672,8 @@ packages:
flat-cache: 4.0.1
dev: true
- /fill-range@7.0.1:
- resolution: {integrity: sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==}
+ /fill-range@7.1.1:
+ resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==}
engines: {node: '>=8'}
dependencies:
to-regex-range: 5.0.1
@@ -4227,7 +4273,7 @@ packages:
engines: {node: '>=10'}
dependencies:
'@jridgewell/trace-mapping': 0.3.25
- debug: 4.3.5
+ debug: 4.3.4
istanbul-lib-coverage: 3.2.2
transitivePeerDependencies:
- supports-color
@@ -4294,7 +4340,7 @@ packages:
'@types/stack-utils': 2.0.3
chalk: 4.1.2
graceful-fs: 4.2.11
- micromatch: 4.0.5
+ micromatch: 4.0.7
pretty-format: 29.7.0
slash: 3.0.0
stack-utils: 2.0.6
@@ -4544,7 +4590,7 @@ packages:
resolution: {integrity: sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==}
engines: {node: '>=10'}
dependencies:
- semver: 7.6.2
+ semver: 7.6.3
dev: true
/meow@12.1.1:
@@ -4564,7 +4610,15 @@ packages:
resolution: {integrity: sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==}
engines: {node: '>=8.6'}
dependencies:
- braces: 3.0.2
+ braces: 3.0.3
+ picomatch: 2.3.1
+ dev: true
+
+ /micromatch@4.0.7:
+ resolution: {integrity: sha512-LPP/3KorzCwBxfeUuZmaR6bG2kdeHSbe0P2tY3FLRU4vYrjYz5hI4QZwV0njUx3jeuKe67YukQ1LSPZBKDqO/Q==}
+ engines: {node: '>=8.6'}
+ dependencies:
+ braces: 3.0.3
picomatch: 2.3.1
/mime-db@1.52.0:
@@ -4710,7 +4764,7 @@ packages:
'@next/env': 14.2.4
'@swc/helpers': 0.5.5
busboy: 1.6.0
- caniuse-lite: 1.0.30001641
+ caniuse-lite: 1.0.30001642
graceful-fs: 4.2.11
postcss: 8.4.31
react: 18.3.1
@@ -4814,15 +4868,6 @@ packages:
es-errors: 1.3.0
dev: true
- /object.hasown@1.1.4:
- resolution: {integrity: sha512-FZ9LZt9/RHzGySlBARE3VF+gE26TxR38SdmqOqliuTnl9wrKulaQs+4dee1V+Io8VfxqzAfHu6YuRgUy8OHoTg==}
- engines: {node: '>= 0.4'}
- dependencies:
- define-properties: 1.2.1
- es-abstract: 1.23.3
- es-object-atoms: 1.0.0
- dev: true
-
/object.values@1.2.0:
resolution: {integrity: sha512-yBYjY9QX2hnRmZHAjG/f13MzmBzxzYgQhFrke06TTyKY5zSTEqkOeukBzIdVA3j3ulu8Qa3MbVFShV7T2RmGtQ==}
engines: {node: '>= 0.4'}
@@ -5051,8 +5096,8 @@ packages:
fast-diff: 1.3.0
dev: true
- /prettier@3.3.2:
- resolution: {integrity: sha512-rAVeHYMcv8ATV5d508CFdn+8/pHPpXeIid1DdrPwXnaAdH7cqjVbpJaT5eq4yRAFU/lsbwYwSF/n5iNrdJHPQA==}
+ /prettier@3.3.3:
+ resolution: {integrity: sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==}
engines: {node: '>=14'}
hasBin: true
dev: true
@@ -5425,6 +5470,12 @@ packages:
hasBin: true
dev: true
+ /semver@7.6.3:
+ resolution: {integrity: sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==}
+ engines: {node: '>=10'}
+ hasBin: true
+ dev: true
+
/set-function-length@1.2.2:
resolution: {integrity: sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==}
engines: {node: '>= 0.4'}
@@ -5578,6 +5629,13 @@ packages:
side-channel: 1.0.6
dev: true
+ /string.prototype.repeat@1.0.0:
+ resolution: {integrity: sha512-0u/TldDbKD8bFCQ/4f5+mNRrXwZ8hg2w7ZR8wa16e8z9XpePWl3eGEcUD0OXpEH/VJH/2G3gjUtR3ZOiBe2S/w==}
+ dependencies:
+ define-properties: 1.2.1
+ es-abstract: 1.23.3
+ dev: true
+
/string.prototype.trim@1.2.9:
resolution: {integrity: sha512-klHuCNxiMZ8MlsOihJhJEBJAiMVqU3Z2nEXWfWnIqjN0gEFS9J9+IxKozWWtQGcgoa1WUZzLjKPTr4ZHNFTFxw==}
engines: {node: '>= 0.4'}
@@ -5797,10 +5855,6 @@ packages:
resolution: {integrity: sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==}
dev: true
- /tslib@2.6.2:
- resolution: {integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==}
- dev: true
-
/tslib@2.6.3:
resolution: {integrity: sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ==}
@@ -6264,7 +6318,7 @@ packages:
dependencies:
'@volar/typescript': 1.11.1
'@vue/language-core': 1.8.27(typescript@5.4.5)
- semver: 7.6.2
+ semver: 7.6.3
typescript: 5.4.5
dev: true
From 02b00e075aeb8a291e1fc72b28ffe4eab1787db4 Mon Sep 17 00:00:00 2001
From: Jason Finch
Date: Wed, 17 Jul 2024 10:41:56 +1000
Subject: [PATCH 09/12] fix(eslint): Fix ESLint to run prettier
---
eslint.config.mjs | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/eslint.config.mjs b/eslint.config.mjs
index e86569eb0..990582939 100644
--- a/eslint.config.mjs
+++ b/eslint.config.mjs
@@ -6,7 +6,7 @@ import { FlatCompat } from "@eslint/eslintrc";
import js from "@eslint/js";
import typescriptEslint from "@typescript-eslint/eslint-plugin";
import tsParser from "@typescript-eslint/parser";
-import prettier from "eslint-plugin-prettier";
+import prettier from "eslint-plugin-prettier/recommended";
import react from "eslint-plugin-react";
import simpleImportSort from "eslint-plugin-simple-import-sort";
//import testingLibrary from "eslint-plugin-testing-library";
@@ -38,7 +38,6 @@ export default [{
"**/.changeset",
"**/vite.config.js",
"**/webpack-runtime.js",
- "**/.prettierrc.cjs",
],
}, ...fixupConfigRules(compat.extends(
"plugin:react/recommended",
@@ -48,16 +47,13 @@ export default [{
"plugin:@typescript-eslint/recommended",
"plugin:import/typescript",
"plugin:jsx-a11y/recommended",
- "prettier",
)), {
plugins: {
"@typescript-eslint": fixupPluginRules(typescriptEslint),
"simple-import-sort": simpleImportSort,
//"testing-library": testingLibrary, //Not compatible with ESLint9 yet https://github.com/jsx-eslint/eslint-plugin-react/issues/3699
react: fixupPluginRules(react),
- prettier,
},
-
languageOptions: {
parser: tsParser,
ecmaVersion: 2022,
@@ -179,6 +175,7 @@ export default [{
}],
},
},
+prettier,
//Not compatible with ESLint9 yet https://github.com/jsx-eslint/eslint-plugin-react/issues/3699
// ...compat.extends("plugin:testing-library/react").map(config => ({
// ...config,
From e4f4d9774acb94f968b566b69cb8f11581a76830 Mon Sep 17 00:00:00 2001
From: Alex Werman
Date: Thu, 18 Jul 2024 11:34:32 +0200
Subject: [PATCH 10/12] chore: apply prettier in repo
---
.prettierrc.cjs | 14 +-
CHANGELOG.md | 234 ++---
CONTRIBUTING.md | 5 +-
FAQ.md | 31 +-
MIGRATION_GUIDE_V3_TO_V4.md | 35 +-
MIGRATION_GUIDE_V3_TO_V5.md | 36 +-
MIGRATION_GUIDE_V6_TO_V7.md | 14 +-
README.md | 13 +-
SECURITY.md | 2 +-
eslint.config.mjs | 360 +++----
examples/nextjs-demo/README.md | 58 +-
examples/nextjs-demo/components/layout.js | 47 +-
examples/nextjs-demo/pages/_app.js | 2 +-
examples/nextjs-demo/pages/index.js | 169 ++--
.../nextjs-demo/public/OidcTrustedDomains.js | 23 +-
examples/oidc-client-demo/index.html | 7 +-
.../public/OidcTrustedDomains.js | 29 +-
.../public/staticwebapp.config.json | 28 +-
examples/oidc-client-demo/src/index.tsx | 213 ++--
examples/oidc-client-demo/tsconfig.json | 10 +-
examples/oidc-client-demo/vite.config.js | 2 +-
examples/react-oidc-demo/README.md | 185 ++--
examples/react-oidc-demo/index.html | 7 +-
examples/react-oidc-demo/package.json | 2 +-
.../public/OidcTrustedDomains.js | 43 +-
examples/react-oidc-demo/public/package.json | 2 +-
.../public/staticwebapp.config.json | 28 +-
.../public/tsconfig.eslint.json | 2 +-
.../react-oidc-demo/public/vite.config.js | 15 +-
examples/react-oidc-demo/src/App.spec.tsx | 162 ++-
examples/react-oidc-demo/src/App.tsx | 152 +--
examples/react-oidc-demo/src/FetchUser.tsx | 83 +-
examples/react-oidc-demo/src/Home.tsx | 121 ++-
examples/react-oidc-demo/src/MultiAuth.tsx | 412 ++++----
examples/react-oidc-demo/src/Profile.tsx | 156 +--
.../react-oidc-demo/src/configurations.ts | 154 +--
examples/react-oidc-demo/src/index.css | 8 +-
examples/react-oidc-demo/src/index.tsx | 6 +-
.../override/AuthenticateError.component.tsx | 12 +-
.../src/override/Authenticating.component.tsx | 8 +-
.../src/override/Callback.component.tsx | 19 +-
.../src/override/Loading.component.tsx | 4 +-
.../ServiceWorkerNotSupported.component.tsx | 11 +-
.../src/override/SessionLost.component.tsx | 38 +-
examples/react-oidc-demo/src/utils/sleep.ts | 4 +-
examples/react-oidc-demo/src/utils/timer.ts | 284 +++---
examples/react-oidc-demo/tsconfig.eslint.json | 2 +-
examples/react-oidc-demo/tsconfig.json | 6 +-
package.json | 2 +-
.../src/OidcServiceWorker.ts | 950 +++++++++---------
.../src/OidcTrustedDomains.js | 30 +-
.../src/__tests__/oidcConfig.spec.ts | 4 +-
.../oidc-client-service-worker/src/crypto.ts | 14 +-
.../oidc-client-service-worker/src/dpop.ts | 51 +-
.../oidc-client-service-worker/src/jwt.ts | 287 +++---
.../src/oidcConfig.ts | 18 +-
.../oidc-client-service-worker/src/types.ts | 208 ++--
.../src/utils/__tests__/codeVerifier.spec.ts | 51 +-
.../src/utils/__tests__/domains.spec.ts | 262 ++---
.../src/utils/__tests__/normalizeUrl.spec.ts | 42 +-
.../utils/__tests__/serializeHeaders.spec.ts | 4 +-
.../src/utils/__tests__/testHelper.ts | 34 +-
.../src/utils/__tests__/tokens.spec.ts | 118 ++-
.../src/utils/codeVerifier.ts | 22 +-
.../src/utils/domains.ts | 148 +--
.../src/utils/normalizeUrl.ts | 13 +-
.../src/utils/sleep.ts | 2 +-
.../src/utils/tokens.ts | 127 +--
.../tsconfig.eslint.json | 2 +-
.../oidc-client-service-worker/vite.config.js | 11 +-
packages/oidc-client/README.md | 70 +-
.../bin/copy-service-worker-files.mjs | 35 +-
.../oidc-client/public/OidcTrustedDomains.js | 26 +-
packages/oidc-client/src/cache.ts | 39 +-
packages/oidc-client/src/checkSession.ts | 142 ++-
.../oidc-client/src/checkSessionIFrame.ts | 139 +--
packages/oidc-client/src/crypto.ts | 52 +-
packages/oidc-client/src/events.ts | 56 +-
packages/oidc-client/src/fetch.ts | 50 +-
packages/oidc-client/src/index.ts | 12 +-
packages/oidc-client/src/iniWorker.spec.ts | 42 +-
packages/oidc-client/src/initSession.ts | 228 ++---
packages/oidc-client/src/initWorker.ts | 509 ++++++----
packages/oidc-client/src/initWorkerOption.ts | 235 ++---
packages/oidc-client/src/jwt.ts | 281 +++---
packages/oidc-client/src/keepSession.ts | 181 ++--
packages/oidc-client/src/location.ts | 50 +-
packages/oidc-client/src/login.ts | 435 ++++----
packages/oidc-client/src/logout.spec.ts | 207 ++--
packages/oidc-client/src/logout.ts | 231 +++--
packages/oidc-client/src/oidc.ts | 763 +++++++-------
packages/oidc-client/src/oidcClient.ts | 234 +++--
packages/oidc-client/src/parseTokens.spec.ts | 374 +++----
packages/oidc-client/src/parseTokens.ts | 407 ++++----
packages/oidc-client/src/renewTokens.ts | 680 +++++++------
packages/oidc-client/src/requests.spec.ts | 12 +-
packages/oidc-client/src/requests.ts | 256 ++---
packages/oidc-client/src/route-utils.spec.ts | 36 +-
packages/oidc-client/src/route-utils.ts | 55 +-
packages/oidc-client/src/silentLogin.ts | 272 ++---
packages/oidc-client/src/timer.ts | 21 +-
packages/oidc-client/src/types.ts | 102 +-
packages/oidc-client/src/user.ts | 29 +-
packages/oidc-client/tests/setup.js | 13 +-
packages/oidc-client/tsconfig.eslint.json | 2 +-
packages/oidc-client/tsconfig.json | 9 +-
packages/oidc-client/vite.config.ts | 2 -
packages/react-oidc/README.md | 201 ++--
.../bin/copy-service-worker-files.mjs | 35 +-
.../react-oidc/public/OidcTrustedDomains.js | 23 +-
packages/react-oidc/src/FetchToken.tsx | 49 +-
packages/react-oidc/src/OidcProvider.tsx | 398 ++++----
packages/react-oidc/src/OidcSecure.tsx | 57 +-
packages/react-oidc/src/ReactOidc.tsx | 321 +++---
packages/react-oidc/src/User.ts | 110 +-
.../Authenticating.component.tsx | 2 +-
.../default-component/Callback.component.tsx | 29 +-
.../default-component/Loading.component.tsx | 6 +-
.../ServiceWorkerNotSupported.component.tsx | 7 +-
.../SessionLost.component.tsx | 2 +-
.../SilentCallback.component.tsx | 25 +-
.../SilentLogin.component.tsx | 36 +-
.../src/core/routes/OidcRoutes.spec.tsx | 4 +-
.../react-oidc/src/core/routes/OidcRoutes.tsx | 16 +-
.../src/core/routes/withRouter.spec.tsx | 11 +-
.../react-oidc/src/core/routes/withRouter.tsx | 40 +-
packages/react-oidc/src/index.ts | 12 +-
packages/react-oidc/tests/setup.js | 4 +-
packages/react-oidc/tsconfig.eslint.json | 2 +-
packages/react-oidc/tsconfig.json | 13 +-
packages/react-oidc/vite.config.ts | 5 +-
131 files changed, 7213 insertions(+), 6140 deletions(-)
diff --git a/.prettierrc.cjs b/.prettierrc.cjs
index dbb27c237..6fb26d080 100644
--- a/.prettierrc.cjs
+++ b/.prettierrc.cjs
@@ -1,12 +1,14 @@
module.exports = {
printWidth: 100,
- semi: true,
- singleQuote: true,
- jsxSingleQuote: true,
tabWidth: 2,
- trailingComma: 'es5',
- useTabs: true,
- plugins: [],
+ trailingComma: 'all',
+ arrowParens: 'avoid',
+ endOfLine: 'auto',
+ bracketSameLine: false,
+ bracketSpacing: true,
+ singleQuote: true,
+ useTabs: false,
+ semi: true,
overrides: [
{
files: ['.*', '*.json', '*.md', '*.toml', '*.yml'],
diff --git a/CHANGELOG.md b/CHANGELOG.md
index b887dbf34..d1fd352e0 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,323 +2,261 @@
## 7.22.18
-- [5ee0cc8](https://github.com/AxaFrance/oidc-client/commit/5ee0cc8f6d823056da221ad081c3821ba9fac343) - fix(oidc): separate state, nonce and codeVerifier for each tab (release) (#1402), 2024-07-16 by *Miya*
-
+- [5ee0cc8](https://github.com/AxaFrance/oidc-client/commit/5ee0cc8f6d823056da221ad081c3821ba9fac343) - fix(oidc): separate state, nonce and codeVerifier for each tab (release) (#1402), 2024-07-16 by _Miya_
## v7.22.17
-- [b099078](https://github.com/AxaFrance/oidc-client/commit/b099078f9d4b61dffd03034f511a4f32e80977a8) - fix(oidc): clenup client internal promises when requests are finished (release) (#1417), 2024-07-15 by *wermanoid*
-- [01f0714](https://github.com/AxaFrance/oidc-client/commit/01f0714241e6442e6b58fcba8b86804ed75cec09) - tests(domain): Be more explicit about intent of test, is to not throw, not return undefined. (#1413), 2024-07-15 by *Jason Finch*
-- [b94fa5c](https://github.com/AxaFrance/oidc-client/commit/b94fa5ca90bd366c4f59a870c428f42872bfacaa) - docs: Minor language change. (#1412), 2024-07-15 by *Jason Finch*
-- [7caee91](https://github.com/AxaFrance/oidc-client/commit/7caee919b4854526dad83203216965746baecabe) - build(job): Update job scripts to v4. (earlier versions are marked deprecated) (#1411), 2024-07-15 by *Jason Finch*
-- [a46b1aa](https://github.com/AxaFrance/oidc-client/commit/a46b1aabe19db70beac342c557ae2c986d16eae7) - fix (FetchToken): Fix FetchToken param to be boolean (#1414), 2024-07-15 by *Jason Finch*
-- [a989ed2](https://github.com/AxaFrance/oidc-client/commit/a989ed29f46b66483bc2c7c51e73bcc19b2c9736) - build(lint): Update lint step to run. (#1409), 2024-07-13 by *Jason Finch*
-
+- [b099078](https://github.com/AxaFrance/oidc-client/commit/b099078f9d4b61dffd03034f511a4f32e80977a8) - fix(oidc): clenup client internal promises when requests are finished (release) (#1417), 2024-07-15 by _wermanoid_
+- [01f0714](https://github.com/AxaFrance/oidc-client/commit/01f0714241e6442e6b58fcba8b86804ed75cec09) - tests(domain): Be more explicit about intent of test, is to not throw, not return undefined. (#1413), 2024-07-15 by _Jason Finch_
+- [b94fa5c](https://github.com/AxaFrance/oidc-client/commit/b94fa5ca90bd366c4f59a870c428f42872bfacaa) - docs: Minor language change. (#1412), 2024-07-15 by _Jason Finch_
+- [7caee91](https://github.com/AxaFrance/oidc-client/commit/7caee919b4854526dad83203216965746baecabe) - build(job): Update job scripts to v4. (earlier versions are marked deprecated) (#1411), 2024-07-15 by _Jason Finch_
+- [a46b1aa](https://github.com/AxaFrance/oidc-client/commit/a46b1aabe19db70beac342c557ae2c986d16eae7) - fix (FetchToken): Fix FetchToken param to be boolean (#1414), 2024-07-15 by _Jason Finch_
+- [a989ed2](https://github.com/AxaFrance/oidc-client/commit/a989ed29f46b66483bc2c7c51e73bcc19b2c9736) - build(lint): Update lint step to run. (#1409), 2024-07-13 by _Jason Finch_
## v7.22.16
-- [72a6373](https://github.com/AxaFrance/oidc-client/commit/72a6373402a53aaaf01ad7fac22f8ad8c6feaff0) - fix(oidc): improve error handling (release) (#1403), 2024-07-11 by *Miya*
-- [c56ceb8](https://github.com/AxaFrance/oidc-client/commit/c56ceb815b28dd5990fe4a1679a61bcebc7e525a) - docs(readme): Update README.md (#1407), 2024-07-12 by *Jason Finch*
-
+- [72a6373](https://github.com/AxaFrance/oidc-client/commit/72a6373402a53aaaf01ad7fac22f8ad8c6feaff0) - fix(oidc): improve error handling (release) (#1403), 2024-07-11 by _Miya_
+- [c56ceb8](https://github.com/AxaFrance/oidc-client/commit/c56ceb815b28dd5990fe4a1679a61bcebc7e525a) - docs(readme): Update README.md (#1407), 2024-07-12 by _Jason Finch_
## v7.22.15
-- [73eae7e](https://github.com/AxaFrance/oidc-client/commit/73eae7e9d68dea6ebec0ed82ba7873941c0e371e) - refactor(oidcServiceWorker): Extract GetCurrentDatabaseTokenEndpoint, add tests. (#1405) (release), 2024-07-11 by *Jason Finch*
-- [e51aef2](https://github.com/AxaFrance/oidc-client/commit/e51aef268e783259c035e3ba58bf9aa16a111bea) - fix (Style): fix 'container' classname in demo. (#1401), 2024-07-11 by *Jason Finch*
-
+- [73eae7e](https://github.com/AxaFrance/oidc-client/commit/73eae7e9d68dea6ebec0ed82ba7873941c0e371e) - refactor(oidcServiceWorker): Extract GetCurrentDatabaseTokenEndpoint, add tests. (#1405) (release), 2024-07-11 by _Jason Finch_
+- [e51aef2](https://github.com/AxaFrance/oidc-client/commit/e51aef268e783259c035e3ba58bf9aa16a111bea) - fix (Style): fix 'container' classname in demo. (#1401), 2024-07-11 by _Jason Finch_
## v7.22.14
-- [25c55ee](https://github.com/AxaFrance/oidc-client/commit/25c55eeb7682356c13987a91d7b8645cca1b0ad5) - refactor(oidc): null coalescing (#1404) (release), 2024-07-11 by *Jason Finch*
-
+- [25c55ee](https://github.com/AxaFrance/oidc-client/commit/25c55eeb7682356c13987a91d7b8645cca1b0ad5) - refactor(oidc): null coalescing (#1404) (release), 2024-07-11 by _Jason Finch_
## v7.22.13
-- [95c814d](https://github.com/AxaFrance/oidc-client/commit/95c814dd9dd325a3a00c3a0dc049d301d983514e) - fix(ci): setup pnpm (release) (#1399), 2024-07-05 by *Guillaume Chervet*
-
+- [95c814d](https://github.com/AxaFrance/oidc-client/commit/95c814dd9dd325a3a00c3a0dc049d301d983514e) - fix(ci): setup pnpm (release) (#1399), 2024-07-05 by _Guillaume Chervet_
## v7.22.12
-
-
## v7.22.11
-
-
## v7.22.10
-- [6c80c5c](https://github.com/AxaFrance/oidc-client/commit/6c80c5cc77750aead50e62136a6594b05f21b42b) - fix(oidc): logout trigger login (release) (#1394), 2024-07-04 by *Guillaume Chervet*
-
+- [6c80c5c](https://github.com/AxaFrance/oidc-client/commit/6c80c5cc77750aead50e62136a6594b05f21b42b) - fix(oidc): logout trigger login (release) (#1394), 2024-07-04 by _Guillaume Chervet_
## v7.22.9
-- [77eb9e1](https://github.com/AxaFrance/oidc-client/commit/77eb9e1841814cfeb6c6672159740dad4c0a9d4d) - fix(oidc): MessageChannel is not closed after message is received (release) (#1396), 2024-07-02 by *radk0s*
-
+- [77eb9e1](https://github.com/AxaFrance/oidc-client/commit/77eb9e1841814cfeb6c6672159740dad4c0a9d4d) - fix(oidc): MessageChannel is not closed after message is received (release) (#1396), 2024-07-02 by _radk0s_
## v7.22.8
-- [c4cf94b](https://github.com/AxaFrance/oidc-client/commit/c4cf94b62a7b2c45cf0f94438a02f0cb5f06b9b0) - fix(oidc): remove dynamic web worker blocked by policies (release) (#1386), 2024-06-18 by *Guillaume Chervet*
-
+- [c4cf94b](https://github.com/AxaFrance/oidc-client/commit/c4cf94b62a7b2c45cf0f94438a02f0cb5f06b9b0) - fix(oidc): remove dynamic web worker blocked by policies (release) (#1386), 2024-06-18 by _Guillaume Chervet_
## v7.22.7
-- [9f4cbf4](https://github.com/AxaFrance/oidc-client/commit/9f4cbf414e1b41f448b2a36d759a035786d26668) - fix(oidc): 2 readmes with the same name (release) (#1377), 2024-06-07 by *meesvandongen*
-- [0bfabd4](https://github.com/AxaFrance/oidc-client/commit/0bfabd41d67cad57415905b7ce729ee4fe85c8b4) - fix(oidc): session lost to quickly (alpha) (#1381), 2024-06-07 by *Guillaume Chervet*
-
+- [9f4cbf4](https://github.com/AxaFrance/oidc-client/commit/9f4cbf414e1b41f448b2a36d759a035786d26668) - fix(oidc): 2 readmes with the same name (release) (#1377), 2024-06-07 by _meesvandongen_
+- [0bfabd4](https://github.com/AxaFrance/oidc-client/commit/0bfabd41d67cad57415905b7ce729ee4fe85c8b4) - fix(oidc): session lost to quickly (alpha) (#1381), 2024-06-07 by _Guillaume Chervet_
## v7.22.6
-- [bcba15b](https://github.com/AxaFrance/oidc-client/commit/bcba15b412063d139c0902de117b0516150c13a2) - fix(react-oidc): compatibility with react 19 (release) (#1372), 2024-05-22 by *Guillaume Chervet*
-- [c49a857](https://github.com/AxaFrance/oidc-client/commit/c49a8572702c485c9a089b0f9aa11eb4bc6e7f1d) - refactor(test): add missing logout test case, 2024-05-22 by *Guillaume Chervet*
-
+- [bcba15b](https://github.com/AxaFrance/oidc-client/commit/bcba15b412063d139c0902de117b0516150c13a2) - fix(react-oidc): compatibility with react 19 (release) (#1372), 2024-05-22 by _Guillaume Chervet_
+- [c49a857](https://github.com/AxaFrance/oidc-client/commit/c49a8572702c485c9a089b0f9aa11eb4bc6e7f1d) - refactor(test): add missing logout test case, 2024-05-22 by _Guillaume Chervet_
## v7.22.5
-- [8d9fd95](https://github.com/AxaFrance/oidc-client/commit/8d9fd9550a74a771936f0e686eb31fe271cd912b) - fix(oidc): user loaded 401 when preload true and not serviceworder mode (release), 2024-05-19 by *Guillaume Chervet*
-- [d764b2b](https://github.com/AxaFrance/oidc-client/commit/d764b2bd7319711c49a393c1fd3496d054661065) - refatcor(all): update librairies, 2024-05-18 by *Guillaume Chervet*
-
+- [8d9fd95](https://github.com/AxaFrance/oidc-client/commit/8d9fd9550a74a771936f0e686eb31fe271cd912b) - fix(oidc): user loaded 401 when preload true and not serviceworder mode (release), 2024-05-19 by _Guillaume Chervet_
+- [d764b2b](https://github.com/AxaFrance/oidc-client/commit/d764b2bd7319711c49a393c1fd3496d054661065) - refatcor(all): update librairies, 2024-05-18 by _Guillaume Chervet_
## v7.22.4
-- [64c76e0](https://github.com/AxaFrance/oidc-client/commit/64c76e0b1f4fccf1c0ed93269a0307212be9d661) - feature(oidc):preload user (release) (#1352), 2024-04-23 by *Guillaume Chervet*
-
+- [64c76e0](https://github.com/AxaFrance/oidc-client/commit/64c76e0b1f4fccf1c0ed93269a0307212be9d661) - feature(oidc):preload user (release) (#1352), 2024-04-23 by _Guillaume Chervet_
## v7.22.3
-- [5af8075](https://github.com/AxaFrance/oidc-client/commit/5af807548e35c64da74fc3547e35c8ec512399ba) - fix(all): types import in index.ts for all typescript (release), 2024-04-18 by *Guillaume Chervet*
-
+- [5af8075](https://github.com/AxaFrance/oidc-client/commit/5af807548e35c64da74fc3547e35c8ec512399ba) - fix(all): types import in index.ts for all typescript (release), 2024-04-18 by _Guillaume Chervet_
## v7.22.2
-- [b17217d](https://github.com/AxaFrance/oidc-client/commit/b17217d6b829dee3b28f444fda099fce9c94bc41) - fix(react-oidc): unused var in User.txs (release), 2024-04-16 by *Guillaume Chervet*
-
+- [b17217d](https://github.com/AxaFrance/oidc-client/commit/b17217d6b829dee3b28f444fda099fce9c94bc41) - fix(react-oidc): unused var in User.txs (release), 2024-04-16 by _Guillaume Chervet_
## v7.22.1
-- [be24658](https://github.com/AxaFrance/oidc-client/commit/be2465852e837b749abd3a86c5c0caa57a2ea8b6) - refactor(all): update libs (release), 2024-04-15 by *Guillaume Chervet*
-
+- [be24658](https://github.com/AxaFrance/oidc-client/commit/be2465852e837b749abd3a86c5c0caa57a2ea8b6) - refactor(all): update libs (release), 2024-04-15 by _Guillaume Chervet_
## v7.22.0
-- [032a00b](https://github.com/AxaFrance/oidc-client/commit/032a00b501557fe6b5be48e83e4914051ee2c7f0) - feat(oidc): control dpop injection (release) (#1342), 2024-04-10 by *Guillaume Chervet*
-
+- [032a00b](https://github.com/AxaFrance/oidc-client/commit/032a00b501557fe6b5be48e83e4914051ee2c7f0) - feat(oidc): control dpop injection (release) (#1342), 2024-04-10 by _Guillaume Chervet_
## v7.21.0
-- [8335b5a](https://github.com/AxaFrance/oidc-client/commit/8335b5a6f5c02d320d642a022ff3828513f5a43e) - feat(dpop): add extras (alpha) (#1325) (release), 2024-03-28 by *Guillaume Chervet*
-
+- [8335b5a](https://github.com/AxaFrance/oidc-client/commit/8335b5a6f5c02d320d642a022ff3828513f5a43e) - feat(dpop): add extras (alpha) (#1325) (release), 2024-03-28 by _Guillaume Chervet_
## v7.20.1
-- [9a3ad3a](https://github.com/AxaFrance/oidc-client/commit/9a3ad3a474a66cc77fa2c3eb3eafa42f167f1e45) - feature(oidc): token renew only when required (release) (#1327), 2024-03-24 by *Guillaume Chervet*
-
+- [9a3ad3a](https://github.com/AxaFrance/oidc-client/commit/9a3ad3a474a66cc77fa2c3eb3eafa42f167f1e45) - feature(oidc): token renew only when required (release) (#1327), 2024-03-24 by _Guillaume Chervet_
## v7.20.0
-- [44d15be](https://github.com/AxaFrance/oidc-client/commit/44d15be1c4d8f5069f15ddc5351e546fc5eb7730) - fix(oidc): userInfo 401 on first login (release), 2024-03-22 by *Guillaume Chervet*
-- [c7793c9](https://github.com/AxaFrance/oidc-client/commit/c7793c9913128dbb82a60dff11261ca5b4749f0c) - feat(oidc-client): add dpop extras to claims (alpha), 2024-03-19 by *Guillaume Chervet*
-
+- [44d15be](https://github.com/AxaFrance/oidc-client/commit/44d15be1c4d8f5069f15ddc5351e546fc5eb7730) - fix(oidc): userInfo 401 on first login (release), 2024-03-22 by _Guillaume Chervet_
+- [c7793c9](https://github.com/AxaFrance/oidc-client/commit/c7793c9913128dbb82a60dff11261ca5b4749f0c) - feat(oidc-client): add dpop extras to claims (alpha), 2024-03-19 by _Guillaume Chervet_
## v7.19.6
-- [b7568f8](https://github.com/AxaFrance/oidc-client/commit/b7568f8d73d21ba1b7cd4890bff2ad30941696e2) - fix(oidc-service-worker): normalize userinfo endpoint in service worker (#1320) (release), 2024-03-13 by *meesvandongen*
-
+- [b7568f8](https://github.com/AxaFrance/oidc-client/commit/b7568f8d73d21ba1b7cd4890bff2ad30941696e2) - fix(oidc-service-worker): normalize userinfo endpoint in service worker (#1320) (release), 2024-03-13 by _meesvandongen_
## v7.19.5
-- [be24bba](https://github.com/AxaFrance/oidc-client/commit/be24bbab3d699ff003cb14302dedc3463b1f3a1b) - refactor(all): update build libraries (release), 2024-03-12 by *Guillaume Chervet*
-
+- [be24bba](https://github.com/AxaFrance/oidc-client/commit/be24bbab3d699ff003cb14302dedc3463b1f3a1b) - refactor(all): update build libraries (release), 2024-03-12 by _Guillaume Chervet_
## v7.19.4
-- [7df257c](https://github.com/AxaFrance/oidc-client/commit/7df257ca7ba32a2605cd5d76881ea3aa50aba208) - refactor(all): update build libraries (release), 2024-03-12 by *Guillaume Chervet*
-
+- [7df257c](https://github.com/AxaFrance/oidc-client/commit/7df257ca7ba32a2605cd5d76881ea3aa50aba208) - refactor(all): update build libraries (release), 2024-03-12 by _Guillaume Chervet_
## v7.19.3
-- [397629d](https://github.com/AxaFrance/oidc-client/commit/397629d2c9e1d58efab96c000247382cfc94ce24) - build(npm): bump vite from 5.0.12 to 5.1.5 (#1319), 2024-03-07 by *dependabot[bot]*
-
+- [397629d](https://github.com/AxaFrance/oidc-client/commit/397629d2c9e1d58efab96c000247382cfc94ce24) - build(npm): bump vite from 5.0.12 to 5.1.5 (#1319), 2024-03-07 by _dependabot[bot]_
## v7.19.2
-- [95be8f7](https://github.com/AxaFrance/oidc-client/commit/95be8f79a3fc399b05322d0197ab674cf272326a) - build(npm): bump vitest from 1.2.2 to 1.3.1 (#1315), 2024-03-07 by *dependabot[bot]*
-
+- [95be8f7](https://github.com/AxaFrance/oidc-client/commit/95be8f79a3fc399b05322d0197ab674cf272326a) - build(npm): bump vitest from 1.2.2 to 1.3.1 (#1315), 2024-03-07 by _dependabot[bot]_
## v7.19.1
-- [7b2b21a](https://github.com/AxaFrance/oidc-client/commit/7b2b21a9837210d0caaea9e16cfea9e9daeb8364) - build(npm): bump rimraf from 5.0.1 to 5.0.5 (#1313) (release), 2024-03-04 by *dependabot[bot]*
-- [d4c9ec6](https://github.com/AxaFrance/oidc-client/commit/d4c9ec6b8a4760c81f4d88bc72563cc810b52b00) - fix(oidc): when having multiple iframes, only the last one gets resolved (#1311) (alpha), 2024-02-28 by *Jean-Marc Rakotoarisoa*
-- [db13d8b](https://github.com/AxaFrance/oidc-client/commit/db13d8bdfbd49e564452461aeefc6e3024ce4435) - doc(oidc-client-demo): fix workflow, 2024-02-23 by *Guillaume Chervet*
-- [322c1f1](https://github.com/AxaFrance/oidc-client/commit/322c1f1fbd3563b27b01a6ca98c8d95eeef12038) - doc(oidc-client-demo): update content and CSP, 2024-02-23 by *Guillaume Chervet*
-- [cf92792](https://github.com/AxaFrance/oidc-client/commit/cf92792db7ede5f35c3e2883f4353376e73ff7e3) - doc(oidc-client-demo): repair demo, 2024-02-23 by *Guillaume Chervet*
-- [fa33e72](https://github.com/AxaFrance/oidc-client/commit/fa33e7250cd5d46c98940c999b8f701116f78446) - doc(oidc-client): update vanilla to add Hack game, 2024-02-23 by *Guillaume Chervet*
-
+- [7b2b21a](https://github.com/AxaFrance/oidc-client/commit/7b2b21a9837210d0caaea9e16cfea9e9daeb8364) - build(npm): bump rimraf from 5.0.1 to 5.0.5 (#1313) (release), 2024-03-04 by _dependabot[bot]_
+- [d4c9ec6](https://github.com/AxaFrance/oidc-client/commit/d4c9ec6b8a4760c81f4d88bc72563cc810b52b00) - fix(oidc): when having multiple iframes, only the last one gets resolved (#1311) (alpha), 2024-02-28 by _Jean-Marc Rakotoarisoa_
+- [db13d8b](https://github.com/AxaFrance/oidc-client/commit/db13d8bdfbd49e564452461aeefc6e3024ce4435) - doc(oidc-client-demo): fix workflow, 2024-02-23 by _Guillaume Chervet_
+- [322c1f1](https://github.com/AxaFrance/oidc-client/commit/322c1f1fbd3563b27b01a6ca98c8d95eeef12038) - doc(oidc-client-demo): update content and CSP, 2024-02-23 by _Guillaume Chervet_
+- [cf92792](https://github.com/AxaFrance/oidc-client/commit/cf92792db7ede5f35c3e2883f4353376e73ff7e3) - doc(oidc-client-demo): repair demo, 2024-02-23 by _Guillaume Chervet_
+- [fa33e72](https://github.com/AxaFrance/oidc-client/commit/fa33e7250cd5d46c98940c999b8f701116f78446) - doc(oidc-client): update vanilla to add Hack game, 2024-02-23 by _Guillaume Chervet_
## v7.19.0
-- [8f3940c](https://github.com/AxaFrance/oidc-client/commit/8f3940c42ad62264abfd61690777b602e0bdc31a) - feat(oidc): dpop inside serviceworker (#1306) (release), 2024-02-22 by *Guillaume Chervet*
-- [4a5887f](https://github.com/AxaFrance/oidc-client/commit/4a5887f5e7b3d739d709c7bb4fb7a007ccb051a1) - fix(oidc-service-worker): remove sw unecessary log, 2024-02-19 by *Guillaume Chervet*
-
+- [8f3940c](https://github.com/AxaFrance/oidc-client/commit/8f3940c42ad62264abfd61690777b602e0bdc31a) - feat(oidc): dpop inside serviceworker (#1306) (release), 2024-02-22 by _Guillaume Chervet_
+- [4a5887f](https://github.com/AxaFrance/oidc-client/commit/4a5887f5e7b3d739d709c7bb4fb7a007ccb051a1) - fix(oidc-service-worker): remove sw unecessary log, 2024-02-19 by _Guillaume Chervet_
## v7.18.5
-- [7a38d96](https://github.com/AxaFrance/oidc-client/commit/7a38d962b0e08837989a1d2affeb5e557dc09444) - fix(oidc): parse token with many _ or - (#1302) (release), 2024-02-18 by *Guillaume Chervet*
-
+- [7a38d96](https://github.com/AxaFrance/oidc-client/commit/7a38d962b0e08837989a1d2affeb5e557dc09444) - fix(oidc): parse token with many \_ or - (#1302) (release), 2024-02-18 by _Guillaume Chervet_
## v7.18.4
-- [b4e5ec8](https://github.com/AxaFrance/oidc-client/commit/b4e5ec834bdfedf8975b79086c2c0144f4e6e9b1) - fix(oidc-service-worker): set Bearer as default (release), 2024-02-17 by *Guillaume Chervet*
-
+- [b4e5ec8](https://github.com/AxaFrance/oidc-client/commit/b4e5ec834bdfedf8975b79086c2c0144f4e6e9b1) - fix(oidc-service-worker): set Bearer as default (release), 2024-02-17 by _Guillaume Chervet_
## v7.18.3
-- [8eb75d3](https://github.com/AxaFrance/oidc-client/commit/8eb75d3f2036708d9c3067a2973a4d685d8b4923) - fix(oidc): logout continue to run before redirecting (#1301) (release), 2024-02-15 by *Guillaume Chervet*
-
+- [8eb75d3](https://github.com/AxaFrance/oidc-client/commit/8eb75d3f2036708d9c3067a2973a4d685d8b4923) - fix(oidc): logout continue to run before redirecting (#1301) (release), 2024-02-15 by _Guillaume Chervet_
## v7.18.2
-- [77329ce](https://github.com/AxaFrance/oidc-client/commit/77329ce52a5fc7278ff35ccd13ca572ff7ebbf4d) - fix(oidc-service-worker): bad request on many token request at the same time (#1300) (release), 2024-02-15 by *Guillaume Chervet*
-
+- [77329ce](https://github.com/AxaFrance/oidc-client/commit/77329ce52a5fc7278ff35ccd13ca572ff7ebbf4d) - fix(oidc-service-worker): bad request on many token request at the same time (#1300) (release), 2024-02-15 by _Guillaume Chervet_
## v7.18.1
-- [0d13cc2](https://github.com/AxaFrance/oidc-client/commit/0d13cc28a8cc40c610d3943d33fe8a7d4e28c32f) - fix(oidc): unload user on logout (#1296) (release), 2024-02-13 by *Guillaume Chervet*
-
+- [0d13cc2](https://github.com/AxaFrance/oidc-client/commit/0d13cc28a8cc40c610d3943d33fe8a7d4e28c32f) - fix(oidc): unload user on logout (#1296) (release), 2024-02-13 by _Guillaume Chervet_
## v7.18.0
-- [5e35346](https://github.com/AxaFrance/oidc-client/commit/5e35346bfa477b560f5bde1afb2125a2c5f6e9c4) - feat(oidc): add extras to revoke access_token and refresh_tokens (#1295) (release), 2024-02-13 by *Guillaume Chervet*
-
+- [5e35346](https://github.com/AxaFrance/oidc-client/commit/5e35346bfa477b560f5bde1afb2125a2c5f6e9c4) - feat(oidc): add extras to revoke access_token and refresh_tokens (#1295) (release), 2024-02-13 by _Guillaume Chervet_
## v7.17.4
-- [91b11af](https://github.com/AxaFrance/oidc-client/commit/91b11afa983bf4bee8def95c4ee101ede5447dc9) - fix(oidc): resfreshTokenError not triggered when silentsignin disabled (release), 2024-02-11 by *Guillaume Chervet*
-
+- [91b11af](https://github.com/AxaFrance/oidc-client/commit/91b11afa983bf4bee8def95c4ee101ede5447dc9) - fix(oidc): resfreshTokenError not triggered when silentsignin disabled (release), 2024-02-11 by _Guillaume Chervet_
## v7.17.3
-- [dbaf602](https://github.com/AxaFrance/oidc-client/commit/dbaf602d31e0b437285496e2711ff7cce5d8d3f7) - fix(react-oidc): typings user can be null (release), 2024-02-11 by *Guillaume Chervet*
-
+- [dbaf602](https://github.com/AxaFrance/oidc-client/commit/dbaf602d31e0b437285496e2711ff7cce5d8d3f7) - fix(react-oidc): typings user can be null (release), 2024-02-11 by _Guillaume Chervet_
## v7.17.2
-- [c3d5c6b](https://github.com/AxaFrance/oidc-client/commit/c3d5c6b1a6a2a82450d134134513634031c1c338) - refactor(react-oidc): remove base64js dependencies (release), 2024-02-11 by *Guillaume Chervet*
-- [2a7031b](https://github.com/AxaFrance/oidc-client/commit/2a7031bfdd5a7c638940ece97778988ead73cbdc) - Merge branch 'main' of https://github.com/AxaFrance/oidc-client, 2024-02-11 by *Guillaume Chervet*
-- [3973497](https://github.com/AxaFrance/oidc-client/commit/397349749e9abb75a6910b3824786f3c688447fe) - Merge branch 'main' of https://github.com/AxaFrance/oidc-client, 2024-02-10 by *Guillaume Chervet*
-- [d20953a](https://github.com/AxaFrance/oidc-client/commit/d20953a0180bdf3b8b6dd3247a025e3b4fc389f8) - refactor(oidc): remove base64.js dependencies (alpha), 2024-02-10 by *Guillaume Chervet*
-
+- [c3d5c6b](https://github.com/AxaFrance/oidc-client/commit/c3d5c6b1a6a2a82450d134134513634031c1c338) - refactor(react-oidc): remove base64js dependencies (release), 2024-02-11 by _Guillaume Chervet_
+- [2a7031b](https://github.com/AxaFrance/oidc-client/commit/2a7031bfdd5a7c638940ece97778988ead73cbdc) - Merge branch 'main' of https://github.com/AxaFrance/oidc-client, 2024-02-11 by _Guillaume Chervet_
+- [3973497](https://github.com/AxaFrance/oidc-client/commit/397349749e9abb75a6910b3824786f3c688447fe) - Merge branch 'main' of https://github.com/AxaFrance/oidc-client, 2024-02-10 by _Guillaume Chervet_
+- [d20953a](https://github.com/AxaFrance/oidc-client/commit/d20953a0180bdf3b8b6dd3247a025e3b4fc389f8) - refactor(oidc): remove base64.js dependencies (alpha), 2024-02-10 by _Guillaume Chervet_
## v7.17.1
-- [2511648](https://github.com/AxaFrance/oidc-client/commit/251164830a9a1b976e8d6c743490795a028afa16) - refactor(oidc): remove base64.js dependency (#1292) (release), 2024-02-10 by *Guillaume Chervet*
-
+- [2511648](https://github.com/AxaFrance/oidc-client/commit/251164830a9a1b976e8d6c743490795a028afa16) - refactor(oidc): remove base64.js dependency (#1292) (release), 2024-02-10 by _Guillaume Chervet_
## v7.17.0
-- [a09e6fd](https://github.com/AxaFrance/oidc-client/commit/a09e6fda64aa210fe7f63d70b6c64af559012640) - feat(oidc): logout add extras parameter to avoid the page reload (release) (#1290), 2024-02-10 by *Guillaume Chervet*
-
+- [a09e6fd](https://github.com/AxaFrance/oidc-client/commit/a09e6fda64aa210fe7f63d70b6c64af559012640) - feat(oidc): logout add extras parameter to avoid the page reload (release) (#1290), 2024-02-10 by _Guillaume Chervet_
## v7.16.0
-- [6b9b524](https://github.com/AxaFrance/oidc-client/commit/6b9b524c54a18dca9cc5bab34f0d058716e9d116) - feat(react): expose dpop method generation (#1291) (release), 2024-02-10 by *Guillaume Chervet*
-
+- [6b9b524](https://github.com/AxaFrance/oidc-client/commit/6b9b524c54a18dca9cc5bab34f0d058716e9d116) - feat(react): expose dpop method generation (#1291) (release), 2024-02-10 by _Guillaume Chervet_
## v7.15.5
-- [d79af9a](https://github.com/AxaFrance/oidc-client/commit/d79af9aba023faf78e9816c4d681413618bdd843) - refactor(all): updates dev libraries (release) (#1284), 2024-02-09 by *Guillaume Chervet*
-
+- [d79af9a](https://github.com/AxaFrance/oidc-client/commit/d79af9aba023faf78e9816c4d681413618bdd843) - refactor(all): updates dev libraries (release) (#1284), 2024-02-09 by _Guillaume Chervet_
## v7.15.4
-- [f2d74fb](https://github.com/AxaFrance/oidc-client/commit/f2d74fba6d2e48e6d478aa69d261fe9cceb69bfa) - fix(oidc): eternal lock when refresh_token invalid and multiple tabs (#1281) (release), 2024-02-03 by *Guillaume Chervet*
-
+- [f2d74fb](https://github.com/AxaFrance/oidc-client/commit/f2d74fba6d2e48e6d478aa69d261fe9cceb69bfa) - fix(oidc): eternal lock when refresh_token invalid and multiple tabs (#1281) (release), 2024-02-03 by _Guillaume Chervet_
## v7.15.3
-- [7a5d32c](https://github.com/AxaFrance/oidc-client/commit/7a5d32cf650870a5b1c2910ceb0a3e6db4cec0b7) - fix(oidc): storage empty update message (release), 2024-02-03 by *Guillaume Chervet*
-
+- [7a5d32c](https://github.com/AxaFrance/oidc-client/commit/7a5d32cf650870a5b1c2910ceb0a3e6db4cec0b7) - fix(oidc): storage empty update message (release), 2024-02-03 by _Guillaume Chervet_
## v7.15.2
-- [940ffac](https://github.com/AxaFrance/oidc-client/commit/940ffac724894460af13e4e4a0de5e691e487c74) - fix(oidc): json not valid add warning message (release) (#1258), 2024-02-03 by *Guillaume Chervet*
-- [31f295c](https://github.com/AxaFrance/oidc-client/commit/31f295cb549bf55dfd5db1e1c71178363c7f2dae) - fix(logout): add event when same config name (alpha), 2024-02-02 by *Guillaume Chervet*
-- [0a15e60](https://github.com/AxaFrance/oidc-client/commit/0a15e60f0e5c167a0418a972c6726eec72add447) - refactor(renew): clean an debug (alpha) (#1273), 2024-02-01 by *Guillaume Chervet*
-
+- [940ffac](https://github.com/AxaFrance/oidc-client/commit/940ffac724894460af13e4e4a0de5e691e487c74) - fix(oidc): json not valid add warning message (release) (#1258), 2024-02-03 by _Guillaume Chervet_
+- [31f295c](https://github.com/AxaFrance/oidc-client/commit/31f295cb549bf55dfd5db1e1c71178363c7f2dae) - fix(logout): add event when same config name (alpha), 2024-02-02 by _Guillaume Chervet_
+- [0a15e60](https://github.com/AxaFrance/oidc-client/commit/0a15e60f0e5c167a0418a972c6726eec72add447) - refactor(renew): clean an debug (alpha) (#1273), 2024-02-01 by _Guillaume Chervet_
## v7.15.1
-- [5094e36](https://github.com/AxaFrance/oidc-client/commit/5094e36c1435684c5863e8d27eca59093aaec7b7) - fix(service-worker): unit test broken (release), 2024-01-30 by *Guillaume Chervet*
-
+- [5094e36](https://github.com/AxaFrance/oidc-client/commit/5094e36c1435684c5863e8d27eca59093aaec7b7) - fix(service-worker): unit test broken (release), 2024-01-30 by _Guillaume Chervet_
## v7.15.0
-- [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*
-
+- [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*
-
+- [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_
## v7.14.0
-- [b0510eb](https://github.com/AxaFrance/oidc-client/commit/b0510eb8d7170e8e142cb2d9bec01f41f610ed51) - feat(oidc): add DPOP configuration (#1259) (release), 2024-01-26 by *Guillaume Chervet*
-
+- [b0510eb](https://github.com/AxaFrance/oidc-client/commit/b0510eb8d7170e8e142cb2d9bec01f41f610ed51) - feat(oidc): add DPOP configuration (#1259) (release), 2024-01-26 by _Guillaume Chervet_
## v7.13.16
-- [f2310bc](https://github.com/AxaFrance/oidc-client/commit/f2310bc917898b779a40edecf3dd73c21ec32b47) - fix(oidc): parseJwt fails for some JWT because of wrong use of replace (release) (#1269), 2024-01-25 by *Guillaume Chervet*
-
+- [f2310bc](https://github.com/AxaFrance/oidc-client/commit/f2310bc917898b779a40edecf3dd73c21ec32b47) - fix(oidc): parseJwt fails for some JWT because of wrong use of replace (release) (#1269), 2024-01-25 by _Guillaume Chervet_
## v7.13.15
-- [c56cc84](https://github.com/AxaFrance/oidc-client/commit/c56cc842d8da427b2aa88eb71f7d63937ea3c363) - fix(react-oidc): missing console.log in useOidcFetch (release), 2024-01-16 by *Guillaume Chervet*
-
+- [c56cc84](https://github.com/AxaFrance/oidc-client/commit/c56cc842d8da427b2aa88eb71f7d63937ea3c363) - fix(react-oidc): missing console.log in useOidcFetch (release), 2024-01-16 by _Guillaume Chervet_
## v7.13.14
-- [3a1883c](https://github.com/AxaFrance/oidc-client/commit/3a1883c343c55637aa1ce5d118cc2841c76d8752) - build(npm): bump react-router-dom from 6.20.1 to 6.21.1 (#1252), 2024-01-02 by *dependabot[bot]*
-
+- [3a1883c](https://github.com/AxaFrance/oidc-client/commit/3a1883c343c55637aa1ce5d118cc2841c76d8752) - build(npm): bump react-router-dom from 6.20.1 to 6.21.1 (#1252), 2024-01-02 by _dependabot[bot]_
## v7.13.13
-- [1faaab4](https://github.com/AxaFrance/oidc-client/commit/1faaab4ecb86144ed6f3c1ed68b938804854bd36) - build(npm): bump next from 14.0.3 to 14.0.4 (#1255), 2024-01-02 by *dependabot[bot]*
-- [d009de8](https://github.com/AxaFrance/oidc-client/commit/d009de8091ac256d1384466df9b3fe7de75a5629) - chore(ci): Update npm-publish.yml, 2023-12-28 by *Guillaume Chervet*
-
+- [1faaab4](https://github.com/AxaFrance/oidc-client/commit/1faaab4ecb86144ed6f3c1ed68b938804854bd36) - build(npm): bump next from 14.0.3 to 14.0.4 (#1255), 2024-01-02 by _dependabot[bot]_
+- [d009de8](https://github.com/AxaFrance/oidc-client/commit/d009de8091ac256d1384466df9b3fe7de75a5629) - chore(ci): Update npm-publish.yml, 2023-12-28 by _Guillaume Chervet_
## v7.13.12
-- [9ef56f1](https://github.com/AxaFrance/oidc-client/commit/9ef56f17793e1bfbd668d6f001125a8f773c2370) - fix(oidc): Handling of errors returned from authorize endpoint (#1250) (release), 2023-12-28 by *Guillaume Chervet*
-
+- [9ef56f1](https://github.com/AxaFrance/oidc-client/commit/9ef56f17793e1bfbd668d6f001125a8f773c2370) - fix(oidc): Handling of errors returned from authorize endpoint (#1250) (release), 2023-12-28 by _Guillaume Chervet_
## v7.13.11
-- [529cabf](https://github.com/AxaFrance/oidc-client/commit/529cabfbe7ee602325ba0f70844c969176371746) - fix(oidc): DPOP type jit instead of jti (#1249) (release), 2023-12-20 by *Guillaume Chervet*
-
+- [529cabf](https://github.com/AxaFrance/oidc-client/commit/529cabfbe7ee602325ba0f70844c969176371746) - fix(oidc): DPOP type jit instead of jti (#1249) (release), 2023-12-20 by _Guillaume Chervet_
## v7.13.10
-- [4b1a9a2](https://github.com/AxaFrance/oidc-client/commit/4b1a9a26eba51e24dd1c9c9fd0087ef0b3b1ce8b) - fix(oidc): crash when regex on userAgent empty result iOS (#1248) (release), 2023-12-20 by *Guillaume Chervet*
-
+- [4b1a9a2](https://github.com/AxaFrance/oidc-client/commit/4b1a9a26eba51e24dd1c9c9fd0087ef0b3b1ce8b) - fix(oidc): crash when regex on userAgent empty result iOS (#1248) (release), 2023-12-20 by _Guillaume Chervet_
## v7.13.9
-- [819962b](https://github.com/AxaFrance/oidc-client/commit/819962bae1d7c1e7fd997ede7bb42cce27ba76f3) - fix(oidc): renew with simple storage (#1246) (release), 2023-12-19 by *Guillaume Chervet*
-
+- [819962b](https://github.com/AxaFrance/oidc-client/commit/819962bae1d7c1e7fd997ede7bb42cce27ba76f3) - fix(oidc): renew with simple storage (#1246) (release), 2023-12-19 by _Guillaume Chervet_
## v7.13.8
-- [b0cf4ad](https://github.com/AxaFrance/oidc-client/commit/b0cf4ad52df9c16c130cce791b05ceea7c4370c4) - fix(oidc): temp renew token fix (#1245) (release), 2023-12-18 by *Guillaume Chervet*
-
+- [b0cf4ad](https://github.com/AxaFrance/oidc-client/commit/b0cf4ad52df9c16c130cce791b05ceea7c4370c4) - fix(oidc): temp renew token fix (#1245) (release), 2023-12-18 by _Guillaume Chervet_
## v7.13.7
-- [6667eab](https://github.com/AxaFrance/oidc-client/commit/6667eabc8c5cb0ff5874b6583b2223721bd18525) - fix(oidc): temporary fix on lock need to be continued but require refactor (release), 2023-12-15 by *Guillaume Chervet*
-- [23c8715](https://github.com/AxaFrance/oidc-client/commit/23c87152e55c8d7f1c51a33032d48c751b15c4c5) - fix(ci): clean changelog generation, 2023-12-15 by *Guillaume Chervet*
-- [9f1f7f6](https://github.com/AxaFrance/oidc-client/commit/9f1f7f684a6b344f59221caf3e3a14faef73a6bc) - fix(oidc): session storage for next (#1240) (alpha), 2023-12-12 by *Guillaume Chervet*
-- [64a8df3](https://github.com/AxaFrance/oidc-client/commit/64a8df3281f95159a60e5f9ec61db315a8d20c7d) - fix(oidc-client): make locks work only ifAvailable (#1237)(alpha), 2023-12-09 by *abhilashlr*
-
-
+- [6667eab](https://github.com/AxaFrance/oidc-client/commit/6667eabc8c5cb0ff5874b6583b2223721bd18525) - fix(oidc): temporary fix on lock need to be continued but require refactor (release), 2023-12-15 by _Guillaume Chervet_
+- [23c8715](https://github.com/AxaFrance/oidc-client/commit/23c87152e55c8d7f1c51a33032d48c751b15c4c5) - fix(ci): clean changelog generation, 2023-12-15 by _Guillaume Chervet_
+- [9f1f7f6](https://github.com/AxaFrance/oidc-client/commit/9f1f7f684a6b344f59221caf3e3a14faef73a6bc) - fix(oidc): session storage for next (#1240) (alpha), 2023-12-12 by _Guillaume Chervet_
+- [64a8df3](https://github.com/AxaFrance/oidc-client/commit/64a8df3281f95159a60e5f9ec61db315a8d20c7d) - fix(oidc-client): make locks work only ifAvailable (#1237)(alpha), 2023-12-09 by _abhilashlr_
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 346f0293e..4cf779635 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -28,6 +28,7 @@ pnpm install
pnpm run dev
# then navigate to http://localhost:3001
```
+
You are now ready to contribute!
## Pull Request
@@ -39,21 +40,23 @@ Packages are automatically published on npm when a PR is merged on main.
Example of commit messages :
To publish a patch version (0.0.x) :
+
- fix(oidc): my message (alpha) => will publish next patch as an alpha
- chore(oidc): my message (beta) => will publish next patch as an beta
- refactor(oidc): my message (release) => will publish next patch release (with automatic git tag and release)
To publish a minor version (0.x.0) :
+
- feat(oidc): my message (alpha) => will publish next minor as an alpha
- feat(oidc): my message (beta) => will publish next minor as an beta
- feat(oidc): my message (release) => will publish next minor release (with automatic git tag and release)
To publish a major version (x.0.0) :
+
- fix(oidc): my message containing BREACKING word (alpha) => will publish next major as an alpha
- fix(oidc): my message containing BREACKING word (beta) => will publish next major as an beta
- fix(oidc): my message containing BREACKING word (release) => will publish next major release (with automatic git tag and release)
-
## Issue
Please respect the following [ISSUE_TEMPLATE.md](./ISSUE_TEMPLATE.md)
diff --git a/FAQ.md b/FAQ.md
index a39a5af41..cb3904add 100644
--- a/FAQ.md
+++ b/FAQ.md
@@ -1,6 +1,6 @@
# FAQ (Frequently Asked Questions)
-## Condition to make silent signing work
+## Condition to make silent signing work
Third-party cookies are blocked by default on Safari and will be blocked on all browsers soon.
Today, silent signing works on Safari only if the OIDC provider and the client application are on the same domain.
@@ -17,24 +17,24 @@ It opens an IFrame in the background, directed to a specific page on your OIDC p
## Condition to make Single Logout to work
-The same domain constraint for "silent signing" applies to Single Logout.
+The same domain constraint for "silent signing" applies to Single Logout.
Single Logout allows you to disconnect from multiple OIDC Client sessions in one action, even if you are connected to different applications.
## Condition to make Monitor Session to work
-Same domain constraint for "silent signing" applies to "monitorSession".
+Same domain constraint for "silent signing" applies to "monitorSession".
Monitor session notifies you when your session expires or when you are disconnected from your OIDC provider.
## Does Service Worker is mandatory ?
-Service Worker can be disable.
+Service Worker can be disable.
You can use classic mode without Service Worker.
Just comment "service_worker_relative_url" like bellow:
-````javascript
+```javascript
export const configuration = {
client_id: 'interactive.public.short',
redirect_uri: window.location.origin + '/#/authentication/callback',
@@ -44,24 +44,24 @@ export const configuration = {
// service_worker_relative_url: '/OidcServiceWorker.js',
service_worker_only: false,
};
-````
+```
-If your Service Worker file is already registered on your browser, your need to unregister it. For example from chrome dev tool.
+If your Service Worker file is already registered on your browser, your need to unregister it. For example from chrome dev tool.
## Tokens are always refreshed in background every seconds
The @axa-fr/oidc-client automatically refreshes tokens in the background.
-It refreshes tokens before expiration to maintain valid tokens at all times.
+It refreshes tokens before expiration to maintain valid tokens at all times.
If your token session lifetime is too short, frequent refreshes will occur.
-Token refreshing starts 120 seconds before expiration.
+Token refreshing starts 120 seconds before expiration.
-Setting a session validity longer than 3 minutes is advisable.
+Setting a session validity longer than 3 minutes is advisable.
By default, @axa-fr/oidc-client chooses the shorter lifetime between access_token and id_token.
Use the "token_renew_mode" option to change this behavior.
- - **token_renew_mode**: String, // Optional, update tokens based on the selected token(s) lifetime: "access_token_or_id_token_invalid" (default), "access_token_invalid", "id_token_invalid"
+- **token_renew_mode**: String, // Optional, update tokens based on the selected token(s) lifetime: "access_token_or_id_token_invalid" (default), "access_token_invalid", "id_token_invalid"
## window.crypto.subtle is unavailable over HTTP
@@ -103,23 +103,22 @@ Quick time-to-market: Start with client-side OIDC, migrate to server-side if nee
@axa-fr/oidc-client is the simplest and cheapest.
-
## Good Security Practices : does a Hacker can unregister the Service Worker and retrieve tokens via an Iframe ?
To block token retrieval via an Iframe call and prevent Service Worker unregistration, comply with these practices:
1 - Correctly configure the CSP (Content Security Policy) on the server side.
-Example:
+Example:
-````bash
+```bash
server: {
headers: {
"Content-Security-Policy": "script-src 'self';",
},
}
-````
+```
-This blocks dynamic script injection into an iframe.
+This blocks dynamic script injection into an iframe.
2 - Initialize `` for **React** or the redirect callback for **oidc-client** at the start of your application script.
Configure it before making any fetch calls to services.
diff --git a/MIGRATION_GUIDE_V3_TO_V4.md b/MIGRATION_GUIDE_V3_TO_V4.md
index dbf072330..91ecb47d7 100644
--- a/MIGRATION_GUIDE_V3_TO_V4.md
+++ b/MIGRATION_GUIDE_V3_TO_V4.md
@@ -18,24 +18,25 @@ Main provider component have been renamed
```javascript
import { AuthenticationProvider } from '@axa-fr/react-oidc-context';
-// old v3
+// old v3
-
-
+;
// in v4 becomes
import { OidcProvider } from '@axa-fr/react-oidc-context';
// loggerLevel : Logger property has been removed in v4
-
-
+;
```
Provider properties have changed, you need to keep only required properties for v4 else it won't work.
```javascript
-// old v3
+// old v3
const propTypes = {
notAuthenticated: PropTypes.elementType, // react component displayed during authentication
notAuthorized: PropTypes.elementType, // react component displayed in case user is not Authorised
@@ -75,7 +76,7 @@ const propTypes = {
UserStore: PropTypes.func,
};
-// new v4
+// new v4
const propTypes = {
loadingComponent: PropTypes.elementType, // you can inject your own loading component
sessionLostComponent: PropTypes.elementType, // you can inject your own session lost component
@@ -100,25 +101,27 @@ const propTypes = {
Manage Oidc actions and information
```javascript
-
-// old v3
+// old v3
import { useReactOidc } from '@axa-fr/react-oidc-context';
-const { isEnabled, login, logout, oidcUser, events } = useReactOidc();
+const { isEnabled, login, logout, oidcUser, events } = useReactOidc();
-
-// new v4
-import { useOidc, useOidcAccessToken, useOidcIdToken, useOidcUser } from '@axa-fr/react-oidc-context';
+// new v4
+import {
+ useOidc,
+ useOidcAccessToken,
+ useOidcIdToken,
+ useOidcUser,
+} from '@axa-fr/react-oidc-context';
const { login, logout, isAuthenticated } = useOidc(); // login and logout return a Promise
const { oidcUser, isOidcUserLoading } = useOidcUser(); // Return user_info endpoint data
const { accessToken, accessTokenPayload } = useOidcAccessToken(); // Contain access_token metadata acess_token is a JWK
const { idToken, idTokenPayload } = useOidcIdToken(); // contain IDToken metadata
-
```
```javascript
-// old v3
+// old v3
import { withFetchRedirectionOn401,
withFetchSilentAuthenticateAndRetryOn401,
withFetchRedirectionOn403,
@@ -160,7 +163,7 @@ Then edit `OidcTrustedDomains.js` in "public" folder for your need
// OidcTrustedDomains.js
// Add here trusted domains, access tokens will be send to
const trustedDomains = {
- default:["http://localhost:4200"],
+ default: ['http://localhost:4200'],
};
```
diff --git a/MIGRATION_GUIDE_V3_TO_V5.md b/MIGRATION_GUIDE_V3_TO_V5.md
index f67cae5de..2e68c48bc 100644
--- a/MIGRATION_GUIDE_V3_TO_V5.md
+++ b/MIGRATION_GUIDE_V3_TO_V5.md
@@ -20,24 +20,25 @@ Main provider component have been renamed
```javascript
import { AuthenticationProvider } from '@axa-fr/react-oidc-context';
-// old v3
+// old v3
-
-
+;
// in v5 becomes
import { OidcProvider } from '@axa-fr/react-oidc-context';
// loggerLevel : Logger property has been removed in v4
-
-
+;
```
Provider properties have changed, you need to keep only required properties for v4 else it won't work.
```javascript
-// old v3
+// old v3
const propTypes = {
notAuthenticated: PropTypes.elementType, // react component displayed during authentication
notAuthorized: PropTypes.elementType, // react component displayed in case user is not Authorised
@@ -103,16 +104,19 @@ const propTypes = {
Manage Oidc actions and information
```javascript
-
-// old v3
+// old v3
import { useReactOidc } from '@axa-fr/react-oidc-context';
-const { isEnabled, login, logout, oidcUser, events } = useReactOidc();
-
+const { isEnabled, login, logout, oidcUser, events } = useReactOidc();
// new v5
-import { useOidc, useOidcAccessToken, useOidcIdToken, useOidcUser } from '@axa-fr/react-oidc-context';
-
-const { login, logout, isAuthenticated} = useOidc(); // login and logout return a Promise
+import {
+ useOidc,
+ useOidcAccessToken,
+ useOidcIdToken,
+ useOidcUser,
+} from '@axa-fr/react-oidc-context';
+
+const { login, logout, isAuthenticated } = useOidc(); // login and logout return a Promise
const { oidcUser, oidcUserLoadingState } = useOidcUser(); // Return user_info endpoint data
const { accessToken, accessTokenPayload } = useOidcAccessToken(); // Contain access_token metadata acess_token is a JWK
const { idToken, idTokenPayload } = useOidcIdToken(); // contain IDToken metadata
@@ -120,7 +124,7 @@ const { idToken, idTokenPayload } = useOidcIdToken(); // contain IDToken metadat
```javascript
-// old v3
+// old v3
import { withFetchRedirectionOn401,
withFetchSilentAuthenticateAndRetryOn401,
withFetchRedirectionOn403,
@@ -136,7 +140,7 @@ import { withOidcFetch } from '@axa-fr/react-oidc-context';
// withFetchToken in v3 have been rename to withOidcFetch and set inside '@axa-fr/react-oidc-context' package
withOidcFetch()
-
+
```
If you need a very secure mode where refresh_token and access_token will be hide behind a service worker that will proxify requests.
@@ -162,7 +166,7 @@ Then edit `OidcTrustedDomains.js` in "public" folder for your need
// OidcTrustedDomains.js
// Add here trusted domains, access tokens will be send to
const trustedDomains = {
- default:["http://localhost:4200"],
+ default: ['http://localhost:4200'],
};
```
diff --git a/MIGRATION_GUIDE_V6_TO_V7.md b/MIGRATION_GUIDE_V6_TO_V7.md
index 51cb01b41..e3b5838fb 100644
--- a/MIGRATION_GUIDE_V6_TO_V7.md
+++ b/MIGRATION_GUIDE_V6_TO_V7.md
@@ -5,15 +5,13 @@
- On version 7.3.0 configuration.service_worker_convert_all_requests_to_cors as been moved to TrustedDomains.js
```javascript
-
// Service worker will continue to give access token to the JavaScript client
// Ideal to hide refresh token from client JavaScript, but to retrieve access_token for some
// scenarios which require it. For example, to send it via websocket connection.
-trustedDomains.config_show_access_token = {
- domains: ['https://demo.duendesoftware.com'],
- showAccessToken: true,
- // convertAllRequestsToCorsExceptNavigate: false, // default value is false
- // setAccessTokenToNavigateRequests: true, // default value is true
+trustedDomains.config_show_access_token = {
+ domains: ['https://demo.duendesoftware.com'],
+ showAccessToken: true,
+ // convertAllRequestsToCorsExceptNavigate: false, // default value is false
+ // setAccessTokenToNavigateRequests: true, // default value is true
};
-
-```
\ No newline at end of file
+```
diff --git a/README.md b/README.md
index 2b5748b5b..823aad7ee 100644
--- a/README.md
+++ b/README.md
@@ -3,7 +3,6 @@
[](https://github.com/AxaFrance/react-oidc/actions/workflows/npm-publish.yml)
[](https://sonarcloud.io/dashboard?id=AxaGuilDEv_react-oidc) [](https://sonarcloud.io/component_measures?id=AxaGuilDEv_react-oidc&metric=reliability_rating) [](https://sonarcloud.io/component_measures?id=AxaGuilDEv_react-oidc&metric=security_rating) [](https://sonarcloud.io/component_measures?id=AxaGuilDEv_react-oidc&metric=Coverage) [](https://twitter.com/intent/follow?screen_name=GuildDEvOpen)
-
[!WARNING]
> If you use `Service Worker` mode, the `OidcServiceWorker.js` file should always be up to date with the version of the library. You may setup a postinstall script in your `package.json` file to update it at each npm install. For example :
@@ -157,7 +155,6 @@ pnpm run dev
The service worker catch access_token and refresh_token that will never be accessible to the client.
-
These components encapsulate the use of "`@axa-fr/oidc-client`" in order to hide workflow complexity.
Internally for "`@axa-fr/react-oidc`", native History API is used to be router library agnostic.
@@ -170,7 +167,7 @@ More information about OIDC :
## FAQ
-- Frequented Asked Question [`FAQ`](./FAQ.md)
+- Frequented Asked Question [`FAQ`](./FAQ.md)
## Migrations
diff --git a/SECURITY.md b/SECURITY.md
index a9c26f5e4..74720879a 100644
--- a/SECURITY.md
+++ b/SECURITY.md
@@ -6,7 +6,7 @@ Use this section to tell people about which versions of your project are
currently being supported with security updates.
| Version | Supported |
-|---------|--------------------|
+| ------- | ------------------ |
| 5.1.x | :white_check_mark: |
| 5.0.x | :x: |
| 4.0.x | :white_check_mark: |
diff --git a/eslint.config.mjs b/eslint.config.mjs
index 990582939..2d46ef43c 100644
--- a/eslint.config.mjs
+++ b/eslint.config.mjs
@@ -1,195 +1,219 @@
-import path from "node:path";
-import { fileURLToPath } from "node:url";
-
-import { fixupConfigRules, fixupPluginRules } from "@eslint/compat";
-import { FlatCompat } from "@eslint/eslintrc";
-import js from "@eslint/js";
-import typescriptEslint from "@typescript-eslint/eslint-plugin";
-import tsParser from "@typescript-eslint/parser";
-import prettier from "eslint-plugin-prettier/recommended";
-import react from "eslint-plugin-react";
-import simpleImportSort from "eslint-plugin-simple-import-sort";
+import path from 'node:path';
+import { fileURLToPath } from 'node:url';
+
+import { fixupConfigRules, fixupPluginRules } from '@eslint/compat';
+import { FlatCompat } from '@eslint/eslintrc';
+import js from '@eslint/js';
+import typescriptEslint from '@typescript-eslint/eslint-plugin';
+import tsParser from '@typescript-eslint/parser';
+import prettier from 'eslint-plugin-prettier/recommended';
+import react from 'eslint-plugin-react';
+import simpleImportSort from 'eslint-plugin-simple-import-sort';
//import testingLibrary from "eslint-plugin-testing-library";
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({
- baseDirectory: __dirname,
- recommendedConfig: js.configs.recommended,
- allConfig: js.configs.all,
+ baseDirectory: __dirname,
+ recommendedConfig: js.configs.recommended,
+ allConfig: js.configs.all,
});
-export default [{
+export default [
+ {
ignores: [
- "**/*.d.ts",
- "packages/**/dist/**/*",
- "packages/**/public/**/*",
- "packages/**/coverage/**/*",
- "packages/**/fixtures/**/*",
- "**/node_modules",
- "public/**/*",
- "examples/**/static/**/*",
- "examples/**/dist/**/*",
- "examples/**/OidcTrustedDomains.js",
- "examples/**/OidcServiceWorker.js",
- "examples/**/nextjs-demo/**",
- "scripts/**/*",
- "**/.github",
- "**/.changeset",
- "**/vite.config.js",
- "**/webpack-runtime.js",
+ '**/*.d.ts',
+ 'packages/**/dist/**/*',
+ 'packages/**/public/**/*',
+ 'packages/**/coverage/**/*',
+ 'packages/**/fixtures/**/*',
+ '**/node_modules',
+ 'public/**/*',
+ 'examples/**/static/**/*',
+ 'examples/**/dist/**/*',
+ 'examples/**/OidcTrustedDomains.js',
+ 'examples/**/OidcServiceWorker.js',
+ 'examples/**/nextjs-demo/**',
+ 'scripts/**/*',
+ '**/.github',
+ '**/.changeset',
+ '**/vite.config.js',
+ '**/webpack-runtime.js',
],
-}, ...fixupConfigRules(compat.extends(
- "plugin:react/recommended",
- "plugin:react-hooks/recommended",
- "eslint:recommended",
- "plugin:@typescript-eslint/eslint-recommended",
- "plugin:@typescript-eslint/recommended",
- "plugin:import/typescript",
- "plugin:jsx-a11y/recommended",
-)), {
+ },
+ ...fixupConfigRules(
+ compat.extends(
+ 'plugin:react/recommended',
+ 'plugin:react-hooks/recommended',
+ 'eslint:recommended',
+ 'plugin:@typescript-eslint/eslint-recommended',
+ 'plugin:@typescript-eslint/recommended',
+ 'plugin:import/typescript',
+ 'plugin:jsx-a11y/recommended',
+ ),
+ ),
+ {
plugins: {
- "@typescript-eslint": fixupPluginRules(typescriptEslint),
- "simple-import-sort": simpleImportSort,
- //"testing-library": testingLibrary, //Not compatible with ESLint9 yet https://github.com/jsx-eslint/eslint-plugin-react/issues/3699
- react: fixupPluginRules(react),
+ '@typescript-eslint': fixupPluginRules(typescriptEslint),
+ 'simple-import-sort': simpleImportSort,
+ //"testing-library": testingLibrary, //Not compatible with ESLint9 yet https://github.com/jsx-eslint/eslint-plugin-react/issues/3699
+ react: fixupPluginRules(react),
},
languageOptions: {
- parser: tsParser,
- ecmaVersion: 2022,
- sourceType: "module",
+ parser: tsParser,
+ ecmaVersion: 2022,
+ sourceType: 'module',
- parserOptions: {
- project: ["./tsconfig.eslint.json", "./packages/*/tsconfig.eslint.json"],
+ parserOptions: {
+ project: ['./tsconfig.eslint.json', './packages/*/tsconfig.eslint.json'],
- ecmaFeatures: {
- jsx: true,
- },
-
- warnOnUnsupportedTypeScriptVersion: true,
+ ecmaFeatures: {
+ jsx: true,
},
+
+ warnOnUnsupportedTypeScriptVersion: true,
+ },
},
settings: {
- env: {
- browser: true,
- node: true,
- },
- react: {
- version: "18",
- },
-
- "import/resolver": {
- typescript: {
- alwaysTryTypes: true,
- },
+ env: {
+ browser: true,
+ node: true,
+ },
+ react: {
+ version: '18',
+ },
+
+ 'import/resolver': {
+ typescript: {
+ alwaysTryTypes: true,
},
+ },
},
rules: {
- "@typescript-eslint/interface-name-prefix": "off",
- "@typescript-eslint/no-non-null-assertion": "off",
- "@typescript-eslint/explicit-module-boundary-types": "off",
- "@typescript-eslint/no-explicit-any": "off",
- "@typescript-eslint/ban-ts-comment": "off",
- "no-unused-vars": "off",
-
- "@typescript-eslint/no-unused-vars": ["error", {
- argsIgnorePattern: "^_|req|res|next|err|ctx|args|context|info|index|data",
- ignoreRestSiblings: true,
- }],
-
- "no-array-constructor": "off",
- "@typescript-eslint/no-array-constructor": "warn",
- "no-redeclare": "off",
- "@typescript-eslint/no-redeclare": "warn",
- "no-use-before-define": "off",
-
- "@typescript-eslint/no-use-before-define": ["warn", {
- functions: false,
- classes: false,
- variables: false,
- typedefs: false,
- }],
-
- "no-unused-expressions": "off",
-
- "@typescript-eslint/no-unused-expressions": ["error", {
- allowShortCircuit: true,
- allowTernary: true,
- allowTaggedTemplates: true,
- }],
-
- "@typescript-eslint/triple-slash-reference": "off",
-
- "@typescript-eslint/member-delimiter-style": ["error", {
- multiline: {
- delimiter: "semi",
- requireLast: true,
- },
-
- singleline: {
- delimiter: "semi",
- requireLast: false,
- },
- }],
-
- camelcase: "off",
-
- "comma-dangle": ["error", {
- arrays: "always-multiline",
- objects: "always-multiline",
- imports: "always-multiline",
- exports: "always-multiline",
- functions: "always-multiline",
- }],
-
- "array-callback-return": "warn",
- "jsx-quotes": ["error", "prefer-double"],
- indent: "off",
- semi: ["error", "always"],
- "space-before-function-paren": "off",
- "import/no-named-as-default": "off",
- "import/no-named-as-default-member": "off",
- "import/default": "off",
- "import/named": "off",
- "import/namespace": "off",
- "import/no-unresolved": "off",
- "simple-import-sort/imports": "error",
- "simple-import-sort/exports": "error",
- "react/prop-types": "off",
- "react/jsx-wrap-multilines": "error",
- "react/react-in-jsx-scope": "off",
- "react/display-name": "off",
- "react-hooks/rules-of-hooks": "error",
- "react-hooks/exhaustive-deps": "off",
+ '@typescript-eslint/interface-name-prefix': 'off',
+ '@typescript-eslint/no-non-null-assertion': 'off',
+ '@typescript-eslint/explicit-module-boundary-types': 'off',
+ '@typescript-eslint/no-explicit-any': 'off',
+ '@typescript-eslint/ban-ts-comment': 'off',
+ 'no-unused-vars': 'off',
+
+ '@typescript-eslint/no-unused-vars': [
+ 'error',
+ {
+ argsIgnorePattern: '^_|req|res|next|err|ctx|args|context|info|index|data',
+ ignoreRestSiblings: true,
+ },
+ ],
+
+ 'no-array-constructor': 'off',
+ '@typescript-eslint/no-array-constructor': 'warn',
+ 'no-redeclare': 'off',
+ '@typescript-eslint/no-redeclare': 'warn',
+ 'no-use-before-define': 'off',
+
+ '@typescript-eslint/no-use-before-define': [
+ 'warn',
+ {
+ functions: false,
+ classes: false,
+ variables: false,
+ typedefs: false,
+ },
+ ],
+
+ 'no-unused-expressions': 'off',
+
+ '@typescript-eslint/no-unused-expressions': [
+ 'error',
+ {
+ allowShortCircuit: true,
+ allowTernary: true,
+ allowTaggedTemplates: true,
+ },
+ ],
+
+ '@typescript-eslint/triple-slash-reference': 'off',
+
+ '@typescript-eslint/member-delimiter-style': [
+ 'error',
+ {
+ multiline: {
+ delimiter: 'semi',
+ requireLast: true,
+ },
+
+ singleline: {
+ delimiter: 'semi',
+ requireLast: false,
+ },
+ },
+ ],
+
+ camelcase: 'off',
+
+ 'comma-dangle': [
+ 'error',
+ {
+ arrays: 'always-multiline',
+ objects: 'always-multiline',
+ imports: 'always-multiline',
+ exports: 'always-multiline',
+ functions: 'always-multiline',
+ },
+ ],
+
+ 'array-callback-return': 'warn',
+ 'jsx-quotes': ['error', 'prefer-double'],
+ indent: 'off',
+ semi: ['error', 'always'],
+ 'space-before-function-paren': 'off',
+ 'import/no-named-as-default': 'off',
+ 'import/no-named-as-default-member': 'off',
+ 'import/default': 'off',
+ 'import/named': 'off',
+ 'import/namespace': 'off',
+ 'import/no-unresolved': 'off',
+ 'simple-import-sort/imports': 'error',
+ 'simple-import-sort/exports': 'error',
+ 'react/prop-types': 'off',
+ 'react/jsx-wrap-multilines': 'error',
+ 'react/react-in-jsx-scope': 'off',
+ 'react/display-name': 'off',
+ 'react-hooks/rules-of-hooks': 'error',
+ 'react-hooks/exhaustive-deps': 'off',
},
-}, {
- files: ["**/*.js", "**/*.jsx"],
+ },
+ {
+ files: ['**/*.js', '**/*.jsx'],
rules: {
- "@typescript-eslint/no-var-requires": "off",
+ '@typescript-eslint/no-var-requires': 'off',
- "react/no-unknown-property": [2, {
- ignore: ["jsx", "global"],
- }],
+ 'react/no-unknown-property': [
+ 2,
+ {
+ ignore: ['jsx', 'global'],
+ },
+ ],
},
-},
-prettier,
-//Not compatible with ESLint9 yet https://github.com/jsx-eslint/eslint-plugin-react/issues/3699
-// ...compat.extends("plugin:testing-library/react").map(config => ({
-// ...config,
-// files: ["**/?(*.)+(spec|test).[jt]s?(x)"],
-// })), {
-// files: ["**/?(*.)+(spec|test).[jt]s?(x)"],
-
-// rules: {
-// "testing-library/no-container": "off"
-// "testing-library/await-async-query": "error",
-// "testing-library/no-await-sync-query": "error",
-// testing-library/no-debugging-utils": "off",
-// "testing-library/no-dom-import": "off",
-// "testing-library/no-unnecessary-act": "off",
-// },
-// }
-];
\ No newline at end of file
+ },
+ prettier,
+ //Not compatible with ESLint9 yet https://github.com/jsx-eslint/eslint-plugin-react/issues/3699
+ // ...compat.extends("plugin:testing-library/react").map(config => ({
+ // ...config,
+ // files: ["**/?(*.)+(spec|test).[jt]s?(x)"],
+ // })), {
+ // files: ["**/?(*.)+(spec|test).[jt]s?(x)"],
+
+ // rules: {
+ // "testing-library/no-container": "off"
+ // "testing-library/await-async-query": "error",
+ // "testing-library/no-await-sync-query": "error",
+ // testing-library/no-debugging-utils": "off",
+ // "testing-library/no-dom-import": "off",
+ // "testing-library/no-unnecessary-act": "off",
+ // },
+ // }
+];
diff --git a/examples/nextjs-demo/README.md b/examples/nextjs-demo/README.md
index ee14292a3..763bd368f 100644
--- a/examples/nextjs-demo/README.md
+++ b/examples/nextjs-demo/README.md
@@ -1,6 +1,7 @@
# Nextjs @axa-fr/react-oidc demo
## Getting Started
+
```sh
git clone https://github.com/AxaGuilDEv/react-oidc.git
cd react-oidc/packages/nextjs-demo
@@ -11,44 +12,49 @@ npm run dev
To work with NextJS you need to inject your own history surcharge like the sample below.
component/layout.js
+
```javascript
import { OidcProvider } from '@axa-fr/react-oidc';
-import { useRouter } from 'next/router'
+import { useRouter } from 'next/router';
const configuration = {
- client_id: 'interactive.public.short',
- redirect_uri: 'http://localhost:3001/#authentication/callback',
- silent_redirect_uri: 'http://localhost:3001/#authentication/silent-callback', // Optional activate silent-signin that use cookies between OIDC server and client javascript to restore the session
- scope: 'openid profile email api offline_access',
- authority: 'https://demo.duendesoftware.com'
+ client_id: 'interactive.public.short',
+ redirect_uri: 'http://localhost:3001/#authentication/callback',
+ silent_redirect_uri: 'http://localhost:3001/#authentication/silent-callback', // Optional activate silent-signin that use cookies between OIDC server and client javascript to restore the session
+ scope: 'openid profile email api offline_access',
+ authority: 'https://demo.duendesoftware.com',
};
-const onEvent=(configurationName, eventName, data )=>{
+const onEvent = (configurationName, eventName, data) => {
console.log(`oidc:${configurationName}:${eventName}`, data);
-}
+};
export default function Layout({ children }) {
- const router = useRouter()
- const withCustomHistory= () => {
+ const router = useRouter();
+ const withCustomHistory = () => {
return {
- replaceState: (url) => {
- router.replace({
- pathname: url,
- }).then(() => {
+ replaceState: url => {
+ router
+ .replace({
+ pathname: url,
+ })
+ .then(() => {
window.dispatchEvent(new Event('popstate'));
- });
- }
+ });
+ },
};
};
-
+
return (
- <>
-
- {children}
-
- >
- )
+ <>
+
+ {children}
+
+ >
+ );
}
-
-
-```
\ No newline at end of file
+```
diff --git a/examples/nextjs-demo/components/layout.js b/examples/nextjs-demo/components/layout.js
index 911b8090c..fa8a54e09 100644
--- a/examples/nextjs-demo/components/layout.js
+++ b/examples/nextjs-demo/components/layout.js
@@ -7,35 +7,40 @@ const configuration = {
redirect_uri: 'http://localhost:3001/#authentication/callback',
silent_redirect_uri: 'http://localhost:3001/#authentication/silent-callback', // Optional activate silent-signin that use cookies between OIDC server and client javascript to restore the session
scope: 'openid profile email api offline_access',
- authority: 'https://demo.duendesoftware.com',
+ authority: 'https://demo.duendesoftware.com',
preload_user_info: 'true',
};
-const onEvent=(configurationName, eventName, data )=>{
- // eslint-disable-next-line no-undef
- console.log(`oidc:${configurationName}:${eventName}`, data);
- };
+const onEvent = (configurationName, eventName, data) => {
+ // eslint-disable-next-line no-undef
+ console.log(`oidc:${configurationName}:${eventName}`, data);
+};
export default function Layout({ children }) {
- const router = useRouter();
- const withCustomHistory= () => {
- return {
- replaceState: (url) => {
- router.replace({
- pathname: url,
- }).then(() => {
- // eslint-disable-next-line no-undef
- window.dispatchEvent(new Event('popstate'));
- },
- );
- },
- };
+ const router = useRouter();
+ const withCustomHistory = () => {
+ return {
+ replaceState: url => {
+ router
+ .replace({
+ pathname: url,
+ })
+ .then(() => {
+ // eslint-disable-next-line no-undef
+ window.dispatchEvent(new Event('popstate'));
+ });
+ },
};
+ };
return (
<>
-
- {children}
+
+ {children}
>
);
-}
\ No newline at end of file
+}
diff --git a/examples/nextjs-demo/pages/_app.js b/examples/nextjs-demo/pages/_app.js
index 829aeaaca..95cf06fe0 100644
--- a/examples/nextjs-demo/pages/_app.js
+++ b/examples/nextjs-demo/pages/_app.js
@@ -6,4 +6,4 @@ export default function MyApp({ Component, pageProps }) {
);
-}
\ No newline at end of file
+}
diff --git a/examples/nextjs-demo/pages/index.js b/examples/nextjs-demo/pages/index.js
index 60f18e231..59d6a5f0c 100644
--- a/examples/nextjs-demo/pages/index.js
+++ b/examples/nextjs-demo/pages/index.js
@@ -1,90 +1,97 @@
-import {OidcSecure, OidcUserStatus, useOidc, useOidcAccessToken, useOidcIdToken, useOidcUser} from '@axa-fr/react-oidc';
+import {
+ OidcSecure,
+ OidcUserStatus,
+ useOidc,
+ useOidcAccessToken,
+ useOidcIdToken,
+ useOidcUser,
+} from '@axa-fr/react-oidc';
import Head from 'next/head';
-const isBrowser = () => typeof window !== "undefined";
+const isBrowser = () => typeof window !== 'undefined';
const DisplayUserInfo = () => {
- const{ oidcUser, oidcUserLoadingState } = useOidcUser();
- const { isAuthenticated } = useOidc();
- console.log(
- "isBrowser: " +
- isBrowser() +
- ", isAuthenticated: " +
- isAuthenticated +
- ", oidcUser: "
- );
- console.log(oidcUser);
-
- switch (oidcUserLoadingState){
- case OidcUserStatus.Loading:
- return User Information are loading
;
- case OidcUserStatus.Unauthenticated:
- return you are not authenticated
;
- case OidcUserStatus.LoadingError:
- return Fail to load user information
;
- default:
- return (
-
-
-
User information
-
{JSON.stringify(oidcUser)}
-
-
- );
+ const { oidcUser, oidcUserLoadingState } = useOidcUser();
+ const { isAuthenticated } = useOidc();
+ console.log(
+ 'isBrowser: ' + isBrowser() + ', isAuthenticated: ' + isAuthenticated + ', oidcUser: ',
+ );
+ console.log(oidcUser);
+
+ switch (oidcUserLoadingState) {
+ case OidcUserStatus.Loading:
+ return User Information are loading
;
+ case OidcUserStatus.Unauthenticated:
+ return you are not authenticated
;
+ case OidcUserStatus.LoadingError:
+ return Fail to load user information
;
+ default:
+ return (
+
+
+
User information
+
{JSON.stringify(oidcUser)}
+
+
+ );
}
};
export const Profile = () => {
-
return (
-
-
-
-
-
+
+
+
+
+
);
};
const DisplayAccessToken = () => {
- const{ accessToken, accessTokenPayload } = useOidcAccessToken();
+ const { accessToken, accessTokenPayload } = useOidcAccessToken();
- if(!accessToken){
- return you are not authenticated
;
+ if (!accessToken) {
+ return you are not authenticated
;
}
return (
-
-
-
Access Token
-
- Please consider to configure the ServiceWorker in order to protect your application from XSRF attacks. "access_token" and "refresh_token" will never be accessible from your client side javascript.
- {
Access Token: {JSON.stringify(accessToken)}
}
- {accessTokenPayload != null &&
Access Token Payload: {JSON.stringify(accessTokenPayload)}
}
-
+
+
+
Access Token
+
+ Please consider to configure the ServiceWorker in order to protect your application from
+ XSRF attacks. "access_token" and "refresh_token" will never be
+ accessible from your client side javascript.
+
+ {
Access Token: {JSON.stringify(accessToken)}
}
+ {accessTokenPayload != null && (
+
Access Token Payload: {JSON.stringify(accessTokenPayload)}
+ )}
+
);
};
+const DisplayIdToken = () => {
+ const { idToken, idTokenPayload } = useOidcIdToken();
-const DisplayIdToken =() => {
- const{ idToken, idTokenPayload } = useOidcIdToken();
-
- if(!idToken){
- return
you are not authenticated
;
+ if (!idToken) {
+ return
you are not authenticated
;
}
return (
-
-
-
ID Token
- {
IdToken: {JSON.stringify(idToken)}
}
- {idTokenPayload != null &&
IdToken Payload: {JSON.stringify(idTokenPayload)}
}
-
+
+
+
ID Token
+ {
IdToken: {JSON.stringify(idToken)}
}
+ {idTokenPayload != null && (
+
IdToken Payload: {JSON.stringify(idTokenPayload)}
+ )}
+
);
};
export default function Home() {
-
return (
@@ -93,18 +100,16 @@ export default function Home() {
-
-
+
-
-
+