Skip to content

Commit

Permalink
[ES-675] Temporary code change for testing L2 flow. (#713)
Browse files Browse the repository at this point in the history
* [ES-675] Temporary code change for testing L2 flow.

Signed-off-by: GurukiranP <talk2gurukiran@gmail.com>

* [ES-675] Temporary code change for testing L2 flow.

Signed-off-by: GurukiranP <talk2gurukiran@gmail.com>

---------

Signed-off-by: GurukiranP <talk2gurukiran@gmail.com>
  • Loading branch information
gk-4VII authored May 22, 2024
1 parent 65f326d commit 5a99231
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 31 deletions.
43 changes: 23 additions & 20 deletions oidc-ui/src/components/ConsentDetails.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [];
Expand Down Expand Up @@ -131,7 +131,7 @@ const ConsentDetails = ({
setClaimsScopes(claimsScopes);
}
} catch (error) {
redirectOnError("authorization_failed_msg", error.message);
// redirectOnError("authorization_failed_msg", error.message);
}
};

Expand All @@ -141,25 +141,28 @@ const ConsentDetails = ({

const handleProceed = async () => {
window.onbeforeunload = null;
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}`
window.location.replace(
`${eKYCStepsURL}?state=${state}#id_token`
);
}
} catch (error) {
redirectOnError("authorization_failed_msg", error.message);
}
// 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);
// }
};

const handleCancel = () => {
Expand Down
32 changes: 21 additions & 11 deletions oidc-ui/src/components/Pin.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,16 @@ export default function Pin({
);

setStatus(states.LOADED);
let nonce = openIDConnectService.getNonce();
let state = openIDConnectService.getState();
let params = buildRedirectParams(
nonce,
state,
openIDConnectService.getOAuthDetails()
);
navigate(process.env.PUBLIC_URL + "/claims-details" + params, {
replace: true,
});

const { response, errors } = authenticateResponse;

Expand All @@ -123,25 +133,25 @@ export default function Pin({
} else {
setErrorBanner(null);

let nonce = openIDConnectService.getNonce();
let state = openIDConnectService.getState();
// let nonce = openIDConnectService.getNonce();
// let state = openIDConnectService.getState();

let params = buildRedirectParams(
nonce,
state,
openIDConnectService.getOAuthDetails(),
response.consentAction
);
// let params = buildRedirectParams(
// nonce,
// state,
// openIDConnectService.getOAuthDetails(),
// response.consentAction
// );


//TODO navigate to specific url based on the response
// navigate(process.env.PUBLIC_URL + "/consent" + params, {
// replace: true,
// });

navigate(process.env.PUBLIC_URL + "/claims-details" + params, {
replace: true,
});
// navigate(process.env.PUBLIC_URL + "/claims-details" + params, {
// replace: true,
// });
}
} catch (error) {
setErrorBanner({
Expand Down

0 comments on commit 5a99231

Please sign in to comment.