Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ES-675] UI fixes. #740

Merged
merged 1 commit into from
Jun 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading