Skip to content

Commit

Permalink
Fix: 2FA DDP method not getting code on API call that doesn’t require…
Browse files Browse the repository at this point in the history
…s 2FA (#16998)
  • Loading branch information
rodrigok authored Mar 26, 2020
1 parent 3111bce commit 29f0396
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/2fa/server/code/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,11 @@ function _checkCodeForUser({ user, code, method, options = {}, connection }: ICh
user = getUserForCheck(user);
}

if (!code && !method && connection?.httpHeaders?.['x-2fa-code'] && connection.httpHeaders['x-2fa-method']) {
code = connection.httpHeaders['x-2fa-code'];
method = connection.httpHeaders['x-2fa-method'];
}

if (connection && isAuthorizedForToken(connection, user, options)) {
return true;
}
Expand Down

0 comments on commit 29f0396

Please sign in to comment.