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

fix: launch-authenticator relatesTo work-around #1466

Merged
merged 5 commits into from
Oct 18, 2023
Merged
Changes from 3 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
13 changes: 12 additions & 1 deletion lib/idx/idxState/v1/idxResponseParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,18 @@ export const parseIdxResponse = function parseIdxResponse( authClient: OktaAuthI
const remediationData = idxResponse.remediation?.value || [];

remediationData.forEach(
remediation => expandRelatesTo(idxResponse, remediation)
remediation => {
// TODO: remove once IDX is fixed - OKTA-659181
if (remediation.name === 'launch-authenticator' &&
remediation?.relatesTo?.[0] === 'authenticatorChallenge' &&
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any danger in assuming it's the first and only item in relatesTo?

Suggested change
remediation?.relatesTo?.[0] === 'authenticatorChallenge' &&
remediation.relatesTo?.indexOf('authenticatorChallenge') >= 0 &&

!idxResponse?.authenticatorChallenge
) {
delete remediation.relatesTo;
return;
}

return expandRelatesTo(idxResponse, remediation);
}
);

const remediations = remediationData.map(remediation => convertRemediationAction( authClient, remediation, toPersist ));
Expand Down