From 957ff98cec35f652e92f901a0b0649d22fb10cd2 Mon Sep 17 00:00:00 2001 From: Jens L Date: Mon, 17 Oct 2022 23:54:21 +0200 Subject: [PATCH] bump @axa-fr/react-oidc to 6.9 to fix atob padding bug (#97) * bump @axa-fr/react-oidc to 6.9 to fix atob padding bug * add issuer to auth0AuthorityConfig --- package-lock.json | 15 ++++++++------- package.json | 2 +- src/index.tsx | 18 +++++++++++------- 3 files changed, 20 insertions(+), 15 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9d7f8af..a4e1f20 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "0.1.0", "dependencies": { "@ant-design/icons": "^4.7.0", - "@axa-fr/react-oidc": "^5.14.0", + "@axa-fr/react-oidc": "^6.9.2", "@headlessui/react": "^1.5.0", "@heroicons/react": "^1.0.4", "@testing-library/jest-dom": "^5.11.4", @@ -122,9 +122,10 @@ } }, "node_modules/@axa-fr/react-oidc": { - "version": "5.14.2", - "resolved": "https://registry.npmjs.org/@axa-fr/react-oidc/-/react-oidc-5.14.2.tgz", - "integrity": "sha512-N+ssJlVtVHnsvlusMxY3zLPKCB+lGzeHIxWXUb0WY3uA7Z+jxx7A2m9W1kHbhYzHuihgA3rWIcdKsvtdkeKXwg==", + "version": "6.9.2", + "resolved": "https://registry.npmjs.org/@axa-fr/react-oidc/-/react-oidc-6.9.2.tgz", + "integrity": "sha512-DaAerrnl5uCN89mWIGuIEmXN2APuD1Q+060AsdT0H021BeQkvCkBq0EwjsRUMWrgKzcwWipqN/1e0jpd0QWPQw==", + "hasInstallScript": true, "dependencies": { "@openid/appauth": "1.3.1" }, @@ -16820,9 +16821,9 @@ } }, "@axa-fr/react-oidc": { - "version": "5.14.2", - "resolved": "https://registry.npmjs.org/@axa-fr/react-oidc/-/react-oidc-5.14.2.tgz", - "integrity": "sha512-N+ssJlVtVHnsvlusMxY3zLPKCB+lGzeHIxWXUb0WY3uA7Z+jxx7A2m9W1kHbhYzHuihgA3rWIcdKsvtdkeKXwg==", + "version": "6.9.2", + "resolved": "https://registry.npmjs.org/@axa-fr/react-oidc/-/react-oidc-6.9.2.tgz", + "integrity": "sha512-DaAerrnl5uCN89mWIGuIEmXN2APuD1Q+060AsdT0H021BeQkvCkBq0EwjsRUMWrgKzcwWipqN/1e0jpd0QWPQw==", "requires": { "@openid/appauth": "1.3.1" } diff --git a/package.json b/package.json index deb41f6..18049ef 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "private": true, "dependencies": { "@ant-design/icons": "^4.7.0", - "@axa-fr/react-oidc": "^5.14.0", + "@axa-fr/react-oidc": "^6.9.2", "@headlessui/react": "^1.5.0", "@heroicons/react": "^1.0.4", "@testing-library/jest-dom": "^5.11.4", diff --git a/src/index.tsx b/src/index.tsx index 47e7feb..1826cfc 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -16,12 +16,16 @@ const config = getConfig(); // Unfortunately Auth0 https:///.well-known/openid-configuration doesn't contain end_session_endpoint that // is required for doing logout. Therefore, we need to hardcode the config for auth const auth0AuthorityConfig: AuthorityConfiguration = { - authorization_endpoint: new URL("authorize", config.authority).href, - token_endpoint: new URL("oauth/token", config.authority).href, - revocation_endpoint: new URL("oauth/revoke", config.authority).href, - end_session_endpoint: new URL("v2/logout", config.authority).href, - userinfo_endpoint: new URL("userinfo", config.authority).href, -} as AuthorityConfiguration + issuer: + config.authority.slice(-1) === "/" + ? config.authority + : config.authority + "/", + authorization_endpoint: new URL("authorize", config.authority).href, + token_endpoint: new URL("oauth/token", config.authority).href, + revocation_endpoint: new URL("oauth/revoke", config.authority).href, + end_session_endpoint: new URL("v2/logout", config.authority).href, + userinfo_endpoint: new URL("userinfo", config.authority).href, +} as AuthorityConfiguration; const providerConfig = { authority: config.authority, @@ -64,4 +68,4 @@ root.render( // If you want to start measuring performance in your app, pass a function // to log results (for example: reportWebVitals(console.log)) // or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals -reportWebVitals(); \ No newline at end of file +reportWebVitals();