Skip to content

Commit

Permalink
fix: readonly mode
Browse files Browse the repository at this point in the history
  • Loading branch information
laurentC35 committed Oct 24, 2023
1 parent 36cd620 commit 83ef9be
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/utils/auth/oidcClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,24 @@ export const createOidcClient = async ({
});

const login = async () => {
const { newUrl: redirect_uri } = addParamToUrl({
let { newUrl: redirect_uri } = addParamToUrl({
url: window.location.href,
name: configHashKey,
value: configHash,
});

if (window.location.pathname.startsWith(`/${READ_ONLY}`)) {
const { newUrl } = addParamToUrl({
url: redirect_uri,
name: 'kc_idp_hint',
value: identityProvider,
});
redirect_uri = newUrl;
}

await userManager.signinRedirect({
redirect_uri,
redirectMethod: 'replace',
login_hint: window.location.pathname.startsWith(`/${READ_ONLY}`)
? identityProvider
: null,
});
return new Promise(() => {});
};
Expand Down

0 comments on commit 83ef9be

Please sign in to comment.