Skip to content

Commit

Permalink
Add a null check to getMfaChallengeResponse.
Browse files Browse the repository at this point in the history
  • Loading branch information
Joerger committed Dec 24, 2024
1 parent d71268f commit e6b64f9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions web/packages/teleport/src/services/auth/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,8 @@ const auth = {
mfaType?: DeviceType,
totpCode?: string
): Promise<MfaChallengeResponse> {
if (!challenge) return;

// TODO(Joerger): If mfaType is not provided by a parent component, use some global context
// to display a component, similar to the one used in useMfa. For now we just default to
// whichever method we can succeed with first.
Expand Down
2 changes: 1 addition & 1 deletion web/packages/teleport/src/services/mfa/makeMfa.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export function parseMfaChallengeJson(
!challenge.webauthn_challenge &&
!challenge.totp_challenge
) {
return null;
return;
}

// WebAuthn challenge contains Base64URL(byte) fields that needs to
Expand Down

0 comments on commit e6b64f9

Please sign in to comment.