From 9f3345ade174ac2c22384851cb119c16b67c932f Mon Sep 17 00:00:00 2001 From: jekuaitk Date: Tue, 5 Sep 2023 09:57:45 +0200 Subject: [PATCH 1/2] DISPLAY-1030: Code authorization flow changes --- CHANGELOG.md | 2 ++ src/components/user/login.jsx | 8 ++++---- src/index.js | 8 +++----- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b7ee2bb7e..890faca2e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ All notable changes to this project will be documented in this file. ## [Unreleased] +- [#214](https://github.com/os2display/display-admin-client/pull/214) + OIDC Code authorization flow - [#210](https://github.com/os2display/display-admin-client/pull/210) Use thumbnails for media list if they are set diff --git a/src/components/user/login.jsx b/src/components/user/login.jsx index 41a1aeedc..ac2f15bd1 100644 --- a/src/components/user/login.jsx +++ b/src/components/user/login.jsx @@ -130,19 +130,19 @@ function Login() { useEffect(() => { let isMounted = true; - let idToken = null; + let code = null; let state = null; if (search) { const query = queryString.parse(search); - idToken = query.id_token; + code = query.code; state = query.state; } ConfigLoader.loadConfig().then((config) => { - if (state && idToken) { + if (state && code) { fetch( - `${config.api}v1/authentication/oidc/token?state=${state}&id_token=${idToken}`, + `${config.api}v1/authentication/oidc/token?state=${state}&code=${code}`, { mode: "cors", credentials: "include", diff --git a/src/index.js b/src/index.js index 71232d41b..fa4d7780b 100644 --- a/src/index.js +++ b/src/index.js @@ -10,10 +10,8 @@ const root = createRoot(container); root.render( - - - - - + + + ); From c62138572bf19ad3a0c0cf076e8d75a6e0057b06 Mon Sep 17 00:00:00 2001 From: jekuaitk Date: Tue, 5 Sep 2023 15:09:44 +0200 Subject: [PATCH 2/2] DISPLAY-1030: Updated CHANGELOG --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 890faca2e..1b75c51b0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file. ## [Unreleased] - [#214](https://github.com/os2display/display-admin-client/pull/214) - OIDC Code authorization flow + Use OIDC Code authorization flow and remove React StrictMode. - [#210](https://github.com/os2display/display-admin-client/pull/210) Use thumbnails for media list if they are set