Skip to content

Commit

Permalink
fix: pathname to activate readonly auth mode
Browse files Browse the repository at this point in the history
  • Loading branch information
laurentC35 committed Feb 22, 2023
1 parent cb029f6 commit 3cb338e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/utils/keycloak/keycloakOidcClient.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Keycloak from 'keycloak-js';
import { READ_ONLY } from 'utils/constants';

const getCurrentSurvey = (path) => {
const temp = path.split('/questionnaire/');
Expand Down Expand Up @@ -31,7 +32,7 @@ export const createKeycloakOidcClient = async ({
await keycloakInstance.login({
redirectUri: window.location.href,
// Readonly mode : Internal user login
idpHint: window.location.pathname.startsWith(`/404`)
idpHint: window.location.pathname.startsWith(`/${READ_ONLY}`)
? identityProvider
: null,
});
Expand Down

0 comments on commit 3cb338e

Please sign in to comment.