Skip to content

Commit

Permalink
Merge pull request #214 from os2display/feature/openid-connect-code-flow
Browse files Browse the repository at this point in the history
Code authorization flow
  • Loading branch information
turegjorup authored Sep 29, 2023
2 parents 6150512 + e28ad5a commit 01c2aa4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
8 changes: 4 additions & 4 deletions src/components/user/login.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
8 changes: 3 additions & 5 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@ const root = createRoot(container);

root.render(
<Provider store={store}>
<React.StrictMode>
<BrowserRouter basename="/admin">
<App />
</BrowserRouter>
</React.StrictMode>
<BrowserRouter basename="/admin">
<App />
</BrowserRouter>
</Provider>
);

0 comments on commit 01c2aa4

Please sign in to comment.