Skip to content

Commit e220a90

Browse files
authored
BE-6600 Fixed a bug that the LINKING_BLOCKED_BY_YUBIKEY_2FA status is returned for all 2FA login states. (#90)
* fixed a bug that the LINKING_BLOCKED_BY_YUBIKEY_2FA status is returned all 2fa login state instead of yubikey 2fa * Updated the protobuf * v16.0.88 * Added a method hasYubikeyChannel
1 parent 6ef2c92 commit e220a90

6 files changed

Lines changed: 1385 additions & 5 deletions

File tree

keeperapi/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

keeperapi/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@keeper-security/keeperapi",
33
"description": "Keeper API Javascript SDK",
4-
"version": "16.0.87",
4+
"version": "16.0.88",
55
"browser": "dist/index.es.js",
66
"main": "dist/index.cjs.js",
77
"types": "dist/node/index.d.ts",

keeperapi/src/auth.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {KeyWrapper, platform} from "./platform";
1212
import {
1313
generateEncryptionKey,
1414
generateUidBytes,
15+
hasYubikeyChannel,
1516
normal64,
1617
normal64Bytes,
1718
resolvablePromise,
@@ -51,6 +52,7 @@ import ISsoServiceProviderRequest = Authentication.ISsoServiceProviderRequest;
5152
import LoginType = Authentication.LoginType;
5253
import LoginMethod = Authentication.LoginMethod;
5354
import IAccountSummaryElements = AccountSummary.IAccountSummaryElements;
55+
import ITwoFactorChannelInfo = Authentication.ITwoFactorChannelInfo;
5456

5557
function unifyLoginError(e: any): LoginError {
5658
if (e instanceof Error) {
@@ -482,7 +484,11 @@ export class Auth {
482484
break;
483485
case Authentication.LoginState.REQUIRES_2FA:
484486
try{
485-
if (!!disableLinkingForAccountWithYubikey2fa && !!primaryAccountSessionTokenForLinking) {
487+
if (
488+
!!disableLinkingForAccountWithYubikey2fa &&
489+
!!primaryAccountSessionTokenForLinking &&
490+
hasYubikeyChannel(loginResponse.channels)
491+
) {
486492
return {
487493
result: LoginV3ResultEnum.LINKING_BLOCKED_BY_YUBIKEY_2FA,
488494
}

0 commit comments

Comments
 (0)