Skip to content

Commit

Permalink
lint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
denysoblohin-okta committed Jul 10, 2023
1 parent bf6aa04 commit 6813bec
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions lib/idx/remediators/Base/SelectAuthenticator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export class SelectAuthenticator<T extends SelectAuthenticatorValues = SelectAut
return option;
}

/* eslint complexity:[0,8] */
canRemediate(context?: IdxContext) {
const { authenticators, authenticator } = this.values;
const authenticatorFromRemediation = getAuthenticatorFromRemediation(this.remediation);
Expand All @@ -59,11 +60,11 @@ export class SelectAuthenticator<T extends SelectAuthenticatorValues = SelectAut
const matchedOption = this.findMatchedOption(authenticators, options!);
if (matchedOption) {
// Don't select current authenticator (OKTA-612939)
const isCurrentAuthenticator = context?.currentAuthenticator
&& context?.currentAuthenticator.value.id === matchedOption.relatesTo?.id;
const isCurrentAuthenticatorEnrollment = context?.currentAuthenticatorEnrollment
&& context?.currentAuthenticatorEnrollment.value.id === matchedOption.relatesTo?.id;
return !isCurrentAuthenticator && !isCurrentAuthenticatorEnrollment;
const currentAuthenticator = context?.currentAuthenticator
?? context?.currentAuthenticatorEnrollment;
const isCurrentAuthenticator = currentAuthenticator
&& currentAuthenticator?.value?.id === matchedOption.relatesTo?.id;
return !isCurrentAuthenticator;
}

return false;
Expand Down

0 comments on commit 6813bec

Please sign in to comment.