From 445173d3fc769a5929052c8d89df3ef51cdae1a5 Mon Sep 17 00:00:00 2001 From: Gk <76690271+GurukiranP@users.noreply.github.com> Date: Thu, 23 May 2024 12:25:33 +0530 Subject: [PATCH] [ES-675] Reverted the temporary code. (#714) * [ES-675] Temporary code change for testing L2 flow. Signed-off-by: GurukiranP * [ES-675] Temporary code change for testing L2 flow. Signed-off-by: GurukiranP * [ES-675] Reverted the temporary code. Signed-off-by: GurukiranP --------- Signed-off-by: GurukiranP Signed-off-by: Gk <76690271+GurukiranP@users.noreply.github.com> --- oidc-ui/src/components/ConsentDetails.js | 43 +++++++++++------------- oidc-ui/src/components/Pin.js | 1 - 2 files changed, 20 insertions(+), 24 deletions(-) diff --git a/oidc-ui/src/components/ConsentDetails.js b/oidc-ui/src/components/ConsentDetails.js index 0ff5e3fbf..3d91da324 100644 --- a/oidc-ui/src/components/ConsentDetails.js +++ b/oidc-ui/src/components/ConsentDetails.js @@ -55,7 +55,7 @@ const ConsentDetails = ({ const { response, errors } = consentDetailsResponse; if (errors != null && errors.length > 0) { - // redirectOnError(errors[0].errorCode, t2(`${errors[0].errorCode}`)); + redirectOnError(errors[0].errorCode, t2(`${errors[0].errorCode}`)); return; } else { let claimsScopes = []; @@ -131,7 +131,7 @@ const ConsentDetails = ({ setClaimsScopes(claimsScopes); } } catch (error) { - // redirectOnError("authorization_failed_msg", error.message); + redirectOnError("authorization_failed_msg", error.message); } }; @@ -141,28 +141,25 @@ const ConsentDetails = ({ const handleProceed = async () => { window.onbeforeunload = null; - window.location.replace( - `${eKYCStepsURL}?state=${state}#id_token` - ); - // try { - // const signupRedirectResponse = await authServices.prepareSignupRedirect( - // transactionId, - // window.location.href - // ); - // const { response, errors } = signupRedirectResponse; + try { + const signupRedirectResponse = await authServices.prepareSignupRedirect( + transactionId, + window.location.href + ); + const { response, errors } = signupRedirectResponse; - // if (errors != null && errors.length > 0) { - // redirectOnError(errors[0].errorCode, t2(`${errors[0].errorCode}`)); - // return; - // } else { - // const encodedIdToken = btoa(response.idToken); - // window.location.replace( - // `${eKYCStepsURL}?state=${state}#${encodedIdToken}` - // ); - // } - // } catch (error) { - // redirectOnError("authorization_failed_msg", error.message); - // } + if (errors != null && errors.length > 0) { + redirectOnError(errors[0].errorCode, t2(`${errors[0].errorCode}`)); + return; + } else { + const encodedIdToken = btoa(response.idToken); + window.location.replace( + `${eKYCStepsURL}?state=${state}#${encodedIdToken}` + ); + } + } catch (error) { + redirectOnError("authorization_failed_msg", error.message); + } }; const handleCancel = () => { diff --git a/oidc-ui/src/components/Pin.js b/oidc-ui/src/components/Pin.js index ccb4f4b63..b9b09153d 100644 --- a/oidc-ui/src/components/Pin.js +++ b/oidc-ui/src/components/Pin.js @@ -143,7 +143,6 @@ export default function Pin({ // response.consentAction // ); - //TODO navigate to specific url based on the response // navigate(process.env.PUBLIC_URL + "/consent" + params, { // replace: true,