@metamask-previews/seedless-onboarding-controller 2.4.0-preview-b8fffa99 → 2.4.0-preview-889b5df9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +0 -4
- package/dist/SeedlessOnboardingController.cjs +30 -114
- package/dist/SeedlessOnboardingController.cjs.map +1 -1
- package/dist/SeedlessOnboardingController.d.cts +1 -6
- package/dist/SeedlessOnboardingController.d.cts.map +1 -1
- package/dist/SeedlessOnboardingController.d.mts +1 -6
- package/dist/SeedlessOnboardingController.d.mts.map +1 -1
- package/dist/SeedlessOnboardingController.mjs +31 -115
- package/dist/SeedlessOnboardingController.mjs.map +1 -1
- package/dist/assertions.cjs +1 -16
- package/dist/assertions.cjs.map +1 -1
- package/dist/assertions.d.cts +0 -7
- package/dist/assertions.d.cts.map +1 -1
- package/dist/assertions.d.mts +0 -7
- package/dist/assertions.d.mts.map +1 -1
- package/dist/assertions.mjs +0 -14
- package/dist/assertions.mjs.map +1 -1
- package/dist/constants.cjs +1 -3
- package/dist/constants.cjs.map +1 -1
- package/dist/constants.d.cts +2 -4
- package/dist/constants.d.cts.map +1 -1
- package/dist/constants.d.mts +2 -4
- package/dist/constants.d.mts.map +1 -1
- package/dist/constants.mjs +1 -3
- package/dist/constants.mjs.map +1 -1
- package/dist/index.cjs +1 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +0 -1
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +0 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +0 -1
- package/dist/index.mjs.map +1 -1
- package/dist/types.cjs.map +1 -1
- package/dist/types.d.cts +0 -6
- package/dist/types.d.cts.map +1 -1
- package/dist/types.d.mts +0 -6
- package/dist/types.d.mts.map +1 -1
- package/dist/types.mjs.map +1 -1
- package/package.json +2 -2
|
@@ -9,7 +9,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
9
9
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
10
10
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
11
11
|
};
|
|
12
|
-
var _SeedlessOnboardingController_instances, _SeedlessOnboardingController_vaultEncryptor, _SeedlessOnboardingController_controllerOperationMutex, _SeedlessOnboardingController_vaultOperationMutex, _SeedlessOnboardingController_refreshJWTToken, _SeedlessOnboardingController_revokeRefreshToken, _SeedlessOnboardingController_isUnlocked,
|
|
12
|
+
var _SeedlessOnboardingController_instances, _SeedlessOnboardingController_vaultEncryptor, _SeedlessOnboardingController_controllerOperationMutex, _SeedlessOnboardingController_vaultOperationMutex, _SeedlessOnboardingController_refreshJWTToken, _SeedlessOnboardingController_revokeRefreshToken, _SeedlessOnboardingController_isUnlocked, _SeedlessOnboardingController_submitGlobalPassword, _SeedlessOnboardingController_getAccessToken, _SeedlessOnboardingController_setUnlocked, _SeedlessOnboardingController_persistOprfKey, _SeedlessOnboardingController_persistAuthPubKey, _SeedlessOnboardingController_storeKeyringEncryptionKey, _SeedlessOnboardingController_loadKeyringEncryptionKey, _SeedlessOnboardingController_loadSeedlessEncryptionKey, _SeedlessOnboardingController_recoverAuthPubKey, _SeedlessOnboardingController_recoverEncKey, _SeedlessOnboardingController_fetchAllSecretDataFromMetadataStore, _SeedlessOnboardingController_changeEncryptionKey, _SeedlessOnboardingController_encryptAndStoreSecretData, _SeedlessOnboardingController_unlockVaultAndGetVaultData, _SeedlessOnboardingController_withPersistedSecretMetadataBackupsState, _SeedlessOnboardingController_filterDupesAndUpdateSocialBackupsMetadata, _SeedlessOnboardingController_createNewVaultWithAuthData, _SeedlessOnboardingController_updateVault, _SeedlessOnboardingController_withControllerLock, _SeedlessOnboardingController_withVaultLock, _SeedlessOnboardingController_serializeKeyData, _SeedlessOnboardingController_parseVaultData, _SeedlessOnboardingController_assertIsUnlocked, _SeedlessOnboardingController_assertIsAuthenticatedUser, _SeedlessOnboardingController_assertIsSRPBackedUpUser, _SeedlessOnboardingController_assertPasswordInSync, _SeedlessOnboardingController_resetPasswordOutdatedCache, _SeedlessOnboardingController_revokeRefreshTokenAndUpdateState, _SeedlessOnboardingController_isTokenExpiredError, _SeedlessOnboardingController_isMaxKeyChainLengthError, _SeedlessOnboardingController_executeWithTokenRefresh;
|
|
13
13
|
import { keccak256AndHexify } from "@metamask/auth-network-utils";
|
|
14
14
|
import { BaseController } from "@metamask/base-controller";
|
|
15
15
|
import { ToprfSecureBackup, TOPRFErrorCode, TOPRFError } from "@metamask/toprf-secure-backup";
|
|
@@ -19,7 +19,7 @@ import { bytesToUtf8, utf8ToBytes } from "@noble/ciphers/utils";
|
|
|
19
19
|
import { managedNonce } from "@noble/ciphers/webcrypto";
|
|
20
20
|
import { secp256k1 } from "@noble/curves/secp256k1";
|
|
21
21
|
import { Mutex } from "async-mutex";
|
|
22
|
-
import {
|
|
22
|
+
import { assertIsValidVaultData } from "./assertions.mjs";
|
|
23
23
|
import { controllerName, PASSWORD_OUTDATED_CACHE_TTL_MS, SecretType, SeedlessOnboardingControllerErrorMessage, Web3AuthNetwork } from "./constants.mjs";
|
|
24
24
|
import { PasswordSyncError, RecoveryError } from "./errors.mjs";
|
|
25
25
|
import { projectLogger, createModuleLogger } from "./logger.mjs";
|
|
@@ -132,9 +132,8 @@ export class SeedlessOnboardingController extends BaseController {
|
|
|
132
132
|
* @param options.network - The network to be used for the Seedless Onboarding flow.
|
|
133
133
|
* @param options.refreshJWTToken - A function to get a new jwt token using refresh token.
|
|
134
134
|
* @param options.revokeRefreshToken - A function to revoke the refresh token.
|
|
135
|
-
* @param options.passwordOutdatedCacheTTL - The TTL of the password outdated cache in milliseconds.,
|
|
136
135
|
*/
|
|
137
|
-
constructor({ messenger, state, encryptor, toprfKeyDeriver, network = Web3AuthNetwork.Mainnet, refreshJWTToken, revokeRefreshToken,
|
|
136
|
+
constructor({ messenger, state, encryptor, toprfKeyDeriver, network = Web3AuthNetwork.Mainnet, refreshJWTToken, revokeRefreshToken, }) {
|
|
138
137
|
super({
|
|
139
138
|
name: controllerName,
|
|
140
139
|
metadata: seedlessOnboardingMetadata,
|
|
@@ -156,12 +155,6 @@ export class SeedlessOnboardingController extends BaseController {
|
|
|
156
155
|
* The controller lock is synchronized with the keyring lock.
|
|
157
156
|
*/
|
|
158
157
|
_SeedlessOnboardingController_isUnlocked.set(this, false);
|
|
159
|
-
/**
|
|
160
|
-
* The TTL of the password outdated cache in milliseconds.
|
|
161
|
-
*/
|
|
162
|
-
_SeedlessOnboardingController_passwordOutdatedCacheTTL.set(this, void 0);
|
|
163
|
-
assertIsPasswordOutdatedCacheValid(passwordOutdatedCacheTTL);
|
|
164
|
-
__classPrivateFieldSet(this, _SeedlessOnboardingController_passwordOutdatedCacheTTL, passwordOutdatedCacheTTL, "f");
|
|
165
158
|
__classPrivateFieldSet(this, _SeedlessOnboardingController_vaultEncryptor, encryptor, "f");
|
|
166
159
|
this.toprfClient = new ToprfSecureBackup({
|
|
167
160
|
network,
|
|
@@ -394,7 +387,7 @@ export class SeedlessOnboardingController extends BaseController {
|
|
|
394
387
|
await this.verifyVaultPassword(oldPassword, {
|
|
395
388
|
skipLock: true, // skip lock since we already have the lock
|
|
396
389
|
});
|
|
397
|
-
|
|
390
|
+
await __classPrivateFieldGet(this, _SeedlessOnboardingController_instances, "m", _SeedlessOnboardingController_assertPasswordInSync).call(this, {
|
|
398
391
|
skipCache: true,
|
|
399
392
|
skipLock: true, // skip lock since we already have the lock
|
|
400
393
|
});
|
|
@@ -408,7 +401,6 @@ export class SeedlessOnboardingController extends BaseController {
|
|
|
408
401
|
const { encKey: newEncKey, pwEncKey: newPwEncKey, authKeyPair: newAuthKeyPair, } = await __classPrivateFieldGet(this, _SeedlessOnboardingController_instances, "m", _SeedlessOnboardingController_changeEncryptionKey).call(this, {
|
|
409
402
|
oldPassword,
|
|
410
403
|
newPassword,
|
|
411
|
-
latestKeyIndex,
|
|
412
404
|
});
|
|
413
405
|
// update and encrypt the vault with new password
|
|
414
406
|
await __classPrivateFieldGet(this, _SeedlessOnboardingController_instances, "m", _SeedlessOnboardingController_createNewVaultWithAuthData).call(this, {
|
|
@@ -491,27 +483,14 @@ export class SeedlessOnboardingController extends BaseController {
|
|
|
491
483
|
return await __classPrivateFieldGet(this, _SeedlessOnboardingController_instances, "m", _SeedlessOnboardingController_withControllerLock).call(this, async () => {
|
|
492
484
|
const { toprfEncryptionKey, toprfPwEncryptionKey, toprfAuthKeyPair, revokeToken, } = await __classPrivateFieldGet(this, _SeedlessOnboardingController_instances, "m", _SeedlessOnboardingController_unlockVaultAndGetVaultData).call(this, password);
|
|
493
485
|
__classPrivateFieldGet(this, _SeedlessOnboardingController_instances, "m", _SeedlessOnboardingController_setUnlocked).call(this);
|
|
494
|
-
await __classPrivateFieldGet(this, _SeedlessOnboardingController_instances, "m", _SeedlessOnboardingController_createNewVaultWithAuthData).call(this, {
|
|
495
|
-
password,
|
|
496
|
-
rawToprfEncryptionKey: toprfEncryptionKey,
|
|
497
|
-
rawToprfPwEncryptionKey: toprfPwEncryptionKey,
|
|
498
|
-
rawToprfAuthKeyPair: toprfAuthKeyPair,
|
|
499
|
-
});
|
|
500
486
|
if (revokeToken) {
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
rawToprfEncryptionKey: toprfEncryptionKey,
|
|
509
|
-
rawToprfPwEncryptionKey: toprfPwEncryptionKey,
|
|
510
|
-
rawToprfAuthKeyPair: toprfAuthKeyPair,
|
|
511
|
-
});
|
|
512
|
-
})
|
|
513
|
-
.catch((error) => {
|
|
514
|
-
log('Error revoking refresh token', error);
|
|
487
|
+
await __classPrivateFieldGet(this, _SeedlessOnboardingController_instances, "m", _SeedlessOnboardingController_revokeRefreshTokenAndUpdateState).call(this, revokeToken);
|
|
488
|
+
// re-creating vault to persist the new revoke token
|
|
489
|
+
await __classPrivateFieldGet(this, _SeedlessOnboardingController_instances, "m", _SeedlessOnboardingController_createNewVaultWithAuthData).call(this, {
|
|
490
|
+
password,
|
|
491
|
+
rawToprfEncryptionKey: toprfEncryptionKey,
|
|
492
|
+
rawToprfPwEncryptionKey: toprfPwEncryptionKey,
|
|
493
|
+
rawToprfAuthKeyPair: toprfAuthKeyPair,
|
|
515
494
|
});
|
|
516
495
|
}
|
|
517
496
|
});
|
|
@@ -581,8 +560,6 @@ export class SeedlessOnboardingController extends BaseController {
|
|
|
581
560
|
* @description Check if the current password is outdated compare to the global password.
|
|
582
561
|
*
|
|
583
562
|
* @param options - Optional options object.
|
|
584
|
-
* @param options.globalAuthPubKey - The global auth public key to compare with the current auth public key.
|
|
585
|
-
* If not provided, the global auth public key will be fetched from the backend.
|
|
586
563
|
* @param options.skipCache - If true, bypass the cache and force a fresh check.
|
|
587
564
|
* @param options.skipLock - Whether to skip the lock acquisition. (to prevent deadlock in case the caller already acquired the lock)
|
|
588
565
|
* @returns A promise that resolves to true if the password is outdated, false otherwise.
|
|
@@ -597,28 +574,19 @@ export class SeedlessOnboardingController extends BaseController {
|
|
|
597
574
|
const now = Date.now();
|
|
598
575
|
const isCacheValid = passwordOutdatedCache &&
|
|
599
576
|
now - passwordOutdatedCache.timestamp <
|
|
600
|
-
|
|
577
|
+
PASSWORD_OUTDATED_CACHE_TTL_MS;
|
|
601
578
|
if (isCacheValid) {
|
|
602
579
|
return passwordOutdatedCache.isExpiredPwd;
|
|
603
580
|
}
|
|
604
581
|
}
|
|
605
582
|
const { nodeAuthTokens, authConnectionId, groupedAuthConnectionId, userId, } = this.state;
|
|
606
583
|
const currentDeviceAuthPubKey = __classPrivateFieldGet(this, _SeedlessOnboardingController_instances, "m", _SeedlessOnboardingController_recoverAuthPubKey).call(this);
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
groupedAuthConnectionId,
|
|
614
|
-
userId,
|
|
615
|
-
})
|
|
616
|
-
.catch((error) => {
|
|
617
|
-
log('Error fetching auth pub key', error);
|
|
618
|
-
throw new Error(SeedlessOnboardingControllerErrorMessage.FailedToFetchAuthPubKey);
|
|
619
|
-
});
|
|
620
|
-
globalAuthPubKey = authPubKey;
|
|
621
|
-
}
|
|
584
|
+
const { authPubKey: globalAuthPubKey } = await this.toprfClient.fetchAuthPubKey({
|
|
585
|
+
nodeAuthTokens,
|
|
586
|
+
authConnectionId,
|
|
587
|
+
groupedAuthConnectionId,
|
|
588
|
+
userId,
|
|
589
|
+
});
|
|
622
590
|
// use noble lib to deserialize and compare curve point
|
|
623
591
|
const isExpiredPwd = !secp256k1.ProjectivePoint.fromHex(currentDeviceAuthPubKey).equals(secp256k1.ProjectivePoint.fromHex(globalAuthPubKey));
|
|
624
592
|
// Cache the result in state
|
|
@@ -747,7 +715,7 @@ export class SeedlessOnboardingController extends BaseController {
|
|
|
747
715
|
}
|
|
748
716
|
}
|
|
749
717
|
}
|
|
750
|
-
_SeedlessOnboardingController_vaultEncryptor = new WeakMap(), _SeedlessOnboardingController_controllerOperationMutex = new WeakMap(), _SeedlessOnboardingController_vaultOperationMutex = new WeakMap(), _SeedlessOnboardingController_refreshJWTToken = new WeakMap(), _SeedlessOnboardingController_revokeRefreshToken = new WeakMap(), _SeedlessOnboardingController_isUnlocked = new WeakMap(),
|
|
718
|
+
_SeedlessOnboardingController_vaultEncryptor = new WeakMap(), _SeedlessOnboardingController_controllerOperationMutex = new WeakMap(), _SeedlessOnboardingController_vaultOperationMutex = new WeakMap(), _SeedlessOnboardingController_refreshJWTToken = new WeakMap(), _SeedlessOnboardingController_revokeRefreshToken = new WeakMap(), _SeedlessOnboardingController_isUnlocked = new WeakMap(), _SeedlessOnboardingController_instances = new WeakSet(), _SeedlessOnboardingController_submitGlobalPassword =
|
|
751
719
|
/**
|
|
752
720
|
* @description Submit the global password to the controller, verify the
|
|
753
721
|
* password validity and unlock the controller.
|
|
@@ -773,30 +741,17 @@ async function _SeedlessOnboardingController_submitGlobalPassword({ targetAuthPu
|
|
|
773
741
|
const { pwEncKey } = res;
|
|
774
742
|
const vaultKey = await __classPrivateFieldGet(this, _SeedlessOnboardingController_instances, "m", _SeedlessOnboardingController_loadSeedlessEncryptionKey).call(this, pwEncKey);
|
|
775
743
|
// Unlock the controller
|
|
776
|
-
const { revokeToken, toprfEncryptionKey
|
|
744
|
+
const { revokeToken, toprfEncryptionKey, toprfPwEncryptionKey, toprfAuthKeyPair, } = await __classPrivateFieldGet(this, _SeedlessOnboardingController_instances, "m", _SeedlessOnboardingController_unlockVaultAndGetVaultData).call(this, undefined, vaultKey);
|
|
777
745
|
__classPrivateFieldGet(this, _SeedlessOnboardingController_instances, "m", _SeedlessOnboardingController_setUnlocked).call(this);
|
|
778
|
-
await __classPrivateFieldGet(this, _SeedlessOnboardingController_instances, "m", _SeedlessOnboardingController_createNewVaultWithAuthData).call(this, {
|
|
779
|
-
password: globalPassword,
|
|
780
|
-
rawToprfEncryptionKey: latestEncKey,
|
|
781
|
-
rawToprfPwEncryptionKey: latestPwEncKey,
|
|
782
|
-
rawToprfAuthKeyPair: latestAuthKeyPair,
|
|
783
|
-
});
|
|
784
746
|
if (revokeToken) {
|
|
785
747
|
// revoke and recyle refresh token after unlock to keep refresh token fresh, avoid malicious use of leaked refresh token
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
rawToprfEncryptionKey: latestEncKey,
|
|
794
|
-
rawToprfPwEncryptionKey: latestPwEncKey,
|
|
795
|
-
rawToprfAuthKeyPair: latestAuthKeyPair,
|
|
796
|
-
});
|
|
797
|
-
})
|
|
798
|
-
.catch((error) => {
|
|
799
|
-
log('Error revoking refresh token', error);
|
|
748
|
+
await __classPrivateFieldGet(this, _SeedlessOnboardingController_instances, "m", _SeedlessOnboardingController_revokeRefreshTokenAndUpdateState).call(this, revokeToken);
|
|
749
|
+
// re-creating vault to persist the new revoke token
|
|
750
|
+
await __classPrivateFieldGet(this, _SeedlessOnboardingController_instances, "m", _SeedlessOnboardingController_createNewVaultWithAuthData).call(this, {
|
|
751
|
+
password: globalPassword,
|
|
752
|
+
rawToprfEncryptionKey: toprfEncryptionKey,
|
|
753
|
+
rawToprfPwEncryptionKey: toprfPwEncryptionKey,
|
|
754
|
+
rawToprfAuthKeyPair: toprfAuthKeyPair,
|
|
800
755
|
});
|
|
801
756
|
}
|
|
802
757
|
}
|
|
@@ -972,31 +927,12 @@ async function _SeedlessOnboardingController_recoverEncKey(password) {
|
|
|
972
927
|
* @param params - The function parameters.
|
|
973
928
|
* @param params.oldPassword - The old password to verify.
|
|
974
929
|
* @param params.newPassword - The new password to update.
|
|
975
|
-
* @param params.latestKeyIndex - The key index of the latest key.
|
|
976
930
|
* @returns A promise that resolves to new encryption key and authentication key pair.
|
|
977
931
|
*/
|
|
978
|
-
async function _SeedlessOnboardingController_changeEncryptionKey({ oldPassword, newPassword,
|
|
932
|
+
async function _SeedlessOnboardingController_changeEncryptionKey({ oldPassword, newPassword, }) {
|
|
979
933
|
__classPrivateFieldGet(this, _SeedlessOnboardingController_instances, "m", _SeedlessOnboardingController_assertIsAuthenticatedUser).call(this, this.state);
|
|
980
934
|
const { authConnectionId, groupedAuthConnectionId, userId } = this.state;
|
|
981
|
-
|
|
982
|
-
let pwEncKey;
|
|
983
|
-
let authKeyPair;
|
|
984
|
-
let globalKeyIndex = latestKeyIndex;
|
|
985
|
-
if (!globalKeyIndex) {
|
|
986
|
-
({
|
|
987
|
-
encKey,
|
|
988
|
-
pwEncKey,
|
|
989
|
-
authKeyPair,
|
|
990
|
-
keyShareIndex: globalKeyIndex,
|
|
991
|
-
} = await __classPrivateFieldGet(this, _SeedlessOnboardingController_instances, "m", _SeedlessOnboardingController_recoverEncKey).call(this, oldPassword));
|
|
992
|
-
}
|
|
993
|
-
else {
|
|
994
|
-
({
|
|
995
|
-
toprfEncryptionKey: encKey,
|
|
996
|
-
toprfPwEncryptionKey: pwEncKey,
|
|
997
|
-
toprfAuthKeyPair: authKeyPair,
|
|
998
|
-
} = await __classPrivateFieldGet(this, _SeedlessOnboardingController_instances, "m", _SeedlessOnboardingController_unlockVaultAndGetVaultData).call(this, oldPassword));
|
|
999
|
-
}
|
|
935
|
+
const { encKey, pwEncKey, authKeyPair, keyShareIndex: newKeyShareIndex, } = await __classPrivateFieldGet(this, _SeedlessOnboardingController_instances, "m", _SeedlessOnboardingController_recoverEncKey).call(this, oldPassword);
|
|
1000
936
|
const result = await this.toprfClient.changeEncKey({
|
|
1001
937
|
nodeAuthTokens: this.state.nodeAuthTokens,
|
|
1002
938
|
authConnectionId,
|
|
@@ -1005,7 +941,7 @@ async function _SeedlessOnboardingController_changeEncryptionKey({ oldPassword,
|
|
|
1005
941
|
oldEncKey: encKey,
|
|
1006
942
|
oldPwEncKey: pwEncKey,
|
|
1007
943
|
oldAuthKeyPair: authKeyPair,
|
|
1008
|
-
newKeyShareIndex
|
|
944
|
+
newKeyShareIndex,
|
|
1009
945
|
newPassword,
|
|
1010
946
|
});
|
|
1011
947
|
return result;
|
|
@@ -1347,33 +1283,13 @@ async function _SeedlessOnboardingController_withVaultLock(callback) {
|
|
|
1347
1283
|
* @param options - The options for asserting the password is in sync.
|
|
1348
1284
|
* @param options.skipCache - Whether to skip the cache check.
|
|
1349
1285
|
* @param options.skipLock - Whether to skip the lock acquisition. (to prevent deadlock in case the caller already acquired the lock)
|
|
1350
|
-
* @returns The global auth public key and the latest key index.
|
|
1351
1286
|
* @throws If the password is outdated.
|
|
1352
1287
|
*/
|
|
1353
1288
|
async function _SeedlessOnboardingController_assertPasswordInSync(options) {
|
|
1354
|
-
const
|
|
1355
|
-
if (!nodeAuthTokens || !authConnectionId || !userId) {
|
|
1356
|
-
throw new Error(SeedlessOnboardingControllerErrorMessage.MissingAuthUserInfo);
|
|
1357
|
-
}
|
|
1358
|
-
const { authPubKey, keyIndex: latestKeyIndex } = await this.toprfClient
|
|
1359
|
-
.fetchAuthPubKey({
|
|
1360
|
-
nodeAuthTokens,
|
|
1361
|
-
authConnectionId,
|
|
1362
|
-
groupedAuthConnectionId,
|
|
1363
|
-
userId,
|
|
1364
|
-
})
|
|
1365
|
-
.catch((error) => {
|
|
1366
|
-
log('Error fetching auth pub key', error);
|
|
1367
|
-
throw new Error(SeedlessOnboardingControllerErrorMessage.FailedToFetchAuthPubKey);
|
|
1368
|
-
});
|
|
1369
|
-
const isPasswordOutdated = await this.checkIsPasswordOutdated({
|
|
1370
|
-
...options,
|
|
1371
|
-
globalAuthPubKey: authPubKey,
|
|
1372
|
-
});
|
|
1289
|
+
const isPasswordOutdated = await this.checkIsPasswordOutdated(options);
|
|
1373
1290
|
if (isPasswordOutdated) {
|
|
1374
1291
|
throw new Error(SeedlessOnboardingControllerErrorMessage.OutdatedPassword);
|
|
1375
1292
|
}
|
|
1376
|
-
return { authPubKey, latestKeyIndex };
|
|
1377
1293
|
}, _SeedlessOnboardingController_resetPasswordOutdatedCache = function _SeedlessOnboardingController_resetPasswordOutdatedCache() {
|
|
1378
1294
|
this.update((state) => {
|
|
1379
1295
|
delete state.passwordOutdatedCache;
|