diff --git a/CHANGELOG.md b/CHANGELOG.md index 67fad4074..7131a5dbe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,9 @@ All notable changes to this project will be documented in this file. ## [Unreleased] +- [#214](https://github.com/os2display/display-admin-client/pull/214) + Use OIDC Code authorization flow and remove React StrictMode. + ## [1.4.0] - 2023-09-14 - [#210](https://github.com/os2display/display-admin-client/pull/210) 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( - - - - - + + + );