Fix: 2FA DDP method not getting code on API call that doesn’t requires 2FA (#16998)

pull/16604/head^2
Rodrigo Nascimento 6 years ago committed by GitHub
parent 3111bce41e
commit 29f03966ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      app/2fa/server/code/index.ts

@ -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;
}

Loading…
Cancel
Save