Skip to content

Commit

Permalink
[ES-675] UI fixes. (#740)
Browse files Browse the repository at this point in the history
Signed-off-by: GurukiranP <talk2gurukiran@gmail.com>
  • Loading branch information
gk-4VII authored Jun 3, 2024
1 parent f026a2b commit 6426eb6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 24 deletions.
18 changes: 0 additions & 18 deletions oidc-ui/src/components/Authorize.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,24 +32,6 @@ export default function Authorize({ authService }) {
storeQueryParam(searchParams.toString());

const extractParam = (param) => searchParams.get(param);
const params = [
"nonce",
"state",
"client_id",
"redirect_uri",
"response_type",
"scope",
"acr_values",
"claims",
"claims_locales",
"display",
"max_age",
"prompt",
"ui_locales",
"code_challenge",
"code_challenge_method",
"id_token_hint",
];

const request = {
nonce: extractParam("nonce"),
Expand Down
11 changes: 5 additions & 6 deletions oidc-ui/src/components/ClaimDetails.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const ClaimDetails = ({
i18nKeyPrefix1 = "consentDetails",
i18nKeyPrefix2 = "errors",
}) => {
const { t: t1 } = useTranslation("translation", {
const { t: t1, i18n } = useTranslation("translation", {
keyPrefix: i18nKeyPrefix1,
});
const { t: t2 } = useTranslation("translation", {
Expand All @@ -21,6 +21,7 @@ const ClaimDetails = ({
const [claimsScopes, setClaimsScopes] = useState([]);
const [isPopup, setPopup] = useState(false);
const [isProceedDisabled, setProceedDisabled] = useState(false);
const [isLoading, setIsLoading] = useState(false);

// Parsing the current URL into a URL object
const urlObj = new URL(window.location.href);
Expand All @@ -43,9 +44,6 @@ const ClaimDetails = ({
);

const authServices = new authService(oidcService);
const uiLocales = new URLSearchParams(
atob(authServices.getAuthorizeQueryParam())
).get("ui_locales");

const oAuth_Details = oidcService.getOAuthDetails();
const transactionId = oidcService.getTransactionId();
Expand Down Expand Up @@ -171,7 +169,7 @@ const ClaimDetails = ({
redirectOnError(errors[0].errorCode, t2(errors[0].errorCode));
} else {
const encodedIdToken = btoa(
`id_token_hint=${response.idToken}&ui_locales=${uiLocales}`
`id_token_hint=${response.idToken}&ui_locales=${i18n.language}`
);
window.location.replace(
`${eKYCStepsURL}?state=${state}#${encodedIdToken}`
Expand All @@ -180,6 +178,7 @@ const ClaimDetails = ({
} catch (error) {
redirectOnError("authorization_failed_msg", error.message);
} finally {
setIsLoading(true);
setProceedDisabled(false);
}
};
Expand Down Expand Up @@ -232,7 +231,7 @@ const ClaimDetails = ({
footer={footerButtons}
footerClassname="flex flex-shrink-0 flex-wrap items-center justify-center rounded-b-md p-4 my-4"
/>
) : claimsScopes.length === 0 ? (
) : claimsScopes.length === 0 || isLoading ? (
<LoadingIndicator size="medium" message={"loading_msg"} />
) : (
<>
Expand Down

0 comments on commit 6426eb6

Please sign in to comment.