@metamask-previews/seedless-onboarding-controller 5.0.0-preview-e9293111 → 6.0.0-preview-79b6f72

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 CHANGED
@@ -7,6 +7,26 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ### Fixed
11
+
12
+ - Fixed `InvalidRevokeToken` issue in `refreshAuthTokens` method. ([#7012](https://github.com/MetaMask/core/pull/7012))
13
+
14
+ ## [6.0.0]
15
+
16
+ ### Added
17
+
18
+ - Added new public method, `checkIsSeedlessOnboardingUserAuthenticated` to validate the controller authenticate tokens state. ([#6998](https://github.com/MetaMask/core/pull/6998))
19
+
20
+ ### Changed
21
+
22
+ - **BREAKING** Update `refreshToken` and `revokeToken` params as required in `Authenticate` method. ([#6998](https://github.com/MetaMask/core/pull/6998))
23
+ - Refactor `refreshAuthTokens` method, separately catch refreshJWTToken and authenticate errors. ([#6998](https://github.com/MetaMask/core/pull/6998))
24
+ - Bump `@metamask/toprf-secure-backup` package to `0.10.0`. ([#6998](https://github.com/MetaMask/core/pull/6998))
25
+
26
+ ### Fixed
27
+
28
+ - Fixed `Invalid Access Token` error during rehydration. ([#6998](https://github.com/MetaMask/core/pull/6998))
29
+
10
30
  ## [5.0.0]
11
31
 
12
32
  ### Changed
@@ -202,7 +222,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
202
222
  - `checkIsPasswordOutdated`: Check if the password is current device is outdated, i.e. user changed password in another device.
203
223
  - `clearState`: Reset the state of the controller to the defaults.
204
224
 
205
- [Unreleased]: https://github.com/MetaMask/core/compare/@metamask/seedless-onboarding-controller@5.0.0...HEAD
225
+ [Unreleased]: https://github.com/MetaMask/core/compare/@metamask/seedless-onboarding-controller@6.0.0...HEAD
226
+ [6.0.0]: https://github.com/MetaMask/core/compare/@metamask/seedless-onboarding-controller@5.0.0...@metamask/seedless-onboarding-controller@6.0.0
206
227
  [5.0.0]: https://github.com/MetaMask/core/compare/@metamask/seedless-onboarding-controller@4.1.1...@metamask/seedless-onboarding-controller@5.0.0
207
228
  [4.1.1]: https://github.com/MetaMask/core/compare/@metamask/seedless-onboarding-controller@4.1.0...@metamask/seedless-onboarding-controller@4.1.1
208
229
  [4.1.0]: https://github.com/MetaMask/core/compare/@metamask/seedless-onboarding-controller@4.0.0...@metamask/seedless-onboarding-controller@4.1.0
@@ -10,7 +10,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
10
10
  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");
11
11
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
12
12
  };
13
- var _SeedlessOnboardingController_instances, _SeedlessOnboardingController_vaultEncryptor, _SeedlessOnboardingController_controllerOperationMutex, _SeedlessOnboardingController_vaultOperationMutex, _SeedlessOnboardingController_refreshJWTToken, _SeedlessOnboardingController_revokeRefreshToken, _SeedlessOnboardingController_renewRefreshToken, _SeedlessOnboardingController_passwordOutdatedCacheTTL, _SeedlessOnboardingController_isUnlocked, _SeedlessOnboardingController_cachedDecryptedVaultData, _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_decryptAndParseVaultData, _SeedlessOnboardingController_withPersistedSecretMetadataBackupsState, _SeedlessOnboardingController_filterDupesAndUpdateSocialBackupsMetadata, _SeedlessOnboardingController_createNewVaultWithAuthData, _SeedlessOnboardingController_updateVault, _SeedlessOnboardingController_withControllerLock, _SeedlessOnboardingController_withVaultLock, _SeedlessOnboardingController_parseVaultData, _SeedlessOnboardingController_assertIsUnlocked, _SeedlessOnboardingController_assertIsAuthenticatedUser, _SeedlessOnboardingController_assertIsSRPBackedUpUser, _SeedlessOnboardingController_assertPasswordInSync, _SeedlessOnboardingController_resetPasswordOutdatedCache, _SeedlessOnboardingController_addRefreshTokenToRevokeList, _SeedlessOnboardingController_isTokenExpiredError, _SeedlessOnboardingController_isMaxKeyChainLengthError, _SeedlessOnboardingController_executeWithTokenRefresh;
13
+ var _SeedlessOnboardingController_instances, _SeedlessOnboardingController_vaultEncryptor, _SeedlessOnboardingController_controllerOperationMutex, _SeedlessOnboardingController_vaultOperationMutex, _SeedlessOnboardingController_refreshJWTToken, _SeedlessOnboardingController_revokeRefreshToken, _SeedlessOnboardingController_renewRefreshToken, _SeedlessOnboardingController_passwordOutdatedCacheTTL, _SeedlessOnboardingController_isUnlocked, _SeedlessOnboardingController_cachedDecryptedVaultData, _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_decryptAndParseVaultData, _SeedlessOnboardingController_withPersistedSecretMetadataBackupsState, _SeedlessOnboardingController_filterDupesAndUpdateSocialBackupsMetadata, _SeedlessOnboardingController_createNewVaultWithAuthData, _SeedlessOnboardingController_updateVault, _SeedlessOnboardingController_withControllerLock, _SeedlessOnboardingController_withVaultLock, _SeedlessOnboardingController_parseVaultData, _SeedlessOnboardingController_assertIsUnlocked, _SeedlessOnboardingController_assertIsAuthenticatedUser, _SeedlessOnboardingController_assertIsSRPBackedUpUser, _SeedlessOnboardingController_assertPasswordInSync, _SeedlessOnboardingController_resetPasswordOutdatedCache, _SeedlessOnboardingController_addRefreshTokenToRevokeList, _SeedlessOnboardingController_isAuthTokenError, _SeedlessOnboardingController_isMaxKeyChainLengthError, _SeedlessOnboardingController_executeWithTokenRefresh;
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
15
  exports.SeedlessOnboardingController = exports.getInitialSeedlessOnboardingControllerStateWithDefaults = void 0;
16
16
  const auth_network_utils_1 = require("@metamask/auth-network-utils");
@@ -297,14 +297,12 @@ class SeedlessOnboardingController extends base_controller_1.BaseController {
297
297
  state.authConnection = authConnection;
298
298
  state.socialLoginEmail = socialLoginEmail;
299
299
  state.metadataAccessToken = metadataAccessToken;
300
- state.accessToken = accessToken;
301
- if (refreshToken) {
302
- state.refreshToken = refreshToken;
303
- }
300
+ state.refreshToken = refreshToken;
304
301
  if (revokeToken) {
305
- // Temporarily store revoke token in state for later vault creation
302
+ // Temporarily store revoke token & access token in state for later vault creation
306
303
  state.revokeToken = revokeToken;
307
304
  }
305
+ state.accessToken = accessToken;
308
306
  // we will check if the controller state is properly set with the authenticated user info
309
307
  // before setting the isSeedlessOnboardingUserAuthenticated to true
310
308
  (0, assertions_1.assertIsSeedlessOnboardingUserAuthenticated)(state);
@@ -406,26 +404,26 @@ class SeedlessOnboardingController extends base_controller_1.BaseController {
406
404
  */
407
405
  async fetchAllSecretData(password) {
408
406
  return await __classPrivateFieldGet(this, _SeedlessOnboardingController_instances, "m", _SeedlessOnboardingController_withControllerLock).call(this, async () => {
409
- // assert that the user is authenticated before fetching the secret data
410
- __classPrivateFieldGet(this, _SeedlessOnboardingController_instances, "m", _SeedlessOnboardingController_assertIsAuthenticatedUser).call(this, this.state);
411
- let encKey;
412
- let pwEncKey;
413
- let authKeyPair;
414
- if (password) {
415
- const recoverEncKeyResult = await __classPrivateFieldGet(this, _SeedlessOnboardingController_instances, "m", _SeedlessOnboardingController_recoverEncKey).call(this, password);
416
- encKey = recoverEncKeyResult.encKey;
417
- pwEncKey = recoverEncKeyResult.pwEncKey;
418
- authKeyPair = recoverEncKeyResult.authKeyPair;
419
- }
420
- else {
421
- __classPrivateFieldGet(this, _SeedlessOnboardingController_instances, "m", _SeedlessOnboardingController_assertIsUnlocked).call(this);
422
- // verify the password and unlock the vault
423
- const keysFromVault = await __classPrivateFieldGet(this, _SeedlessOnboardingController_instances, "m", _SeedlessOnboardingController_unlockVaultAndGetVaultData).call(this);
424
- encKey = keysFromVault.toprfEncryptionKey;
425
- pwEncKey = keysFromVault.toprfPwEncryptionKey;
426
- authKeyPair = keysFromVault.toprfAuthKeyPair;
427
- }
428
- const performFetch = async () => {
407
+ return await __classPrivateFieldGet(this, _SeedlessOnboardingController_instances, "m", _SeedlessOnboardingController_executeWithTokenRefresh).call(this, async () => {
408
+ // assert that the user is authenticated before fetching the secret data
409
+ __classPrivateFieldGet(this, _SeedlessOnboardingController_instances, "m", _SeedlessOnboardingController_assertIsAuthenticatedUser).call(this, this.state);
410
+ let encKey;
411
+ let pwEncKey;
412
+ let authKeyPair;
413
+ if (password) {
414
+ const recoverEncKeyResult = await __classPrivateFieldGet(this, _SeedlessOnboardingController_instances, "m", _SeedlessOnboardingController_recoverEncKey).call(this, password);
415
+ encKey = recoverEncKeyResult.encKey;
416
+ pwEncKey = recoverEncKeyResult.pwEncKey;
417
+ authKeyPair = recoverEncKeyResult.authKeyPair;
418
+ }
419
+ else {
420
+ __classPrivateFieldGet(this, _SeedlessOnboardingController_instances, "m", _SeedlessOnboardingController_assertIsUnlocked).call(this);
421
+ // verify the password and unlock the vault
422
+ const keysFromVault = await __classPrivateFieldGet(this, _SeedlessOnboardingController_instances, "m", _SeedlessOnboardingController_unlockVaultAndGetVaultData).call(this);
423
+ encKey = keysFromVault.toprfEncryptionKey;
424
+ pwEncKey = keysFromVault.toprfPwEncryptionKey;
425
+ authKeyPair = keysFromVault.toprfAuthKeyPair;
426
+ }
429
427
  const secrets = await __classPrivateFieldGet(this, _SeedlessOnboardingController_instances, "m", _SeedlessOnboardingController_fetchAllSecretDataFromMetadataStore).call(this, encKey, authKeyPair);
430
428
  if (password) {
431
429
  // if password is provided, we need to create a new vault with the auth data. (supposedly the user is trying to rehydrate the wallet)
@@ -437,8 +435,7 @@ class SeedlessOnboardingController extends base_controller_1.BaseController {
437
435
  });
438
436
  }
439
437
  return secrets;
440
- };
441
- return await __classPrivateFieldGet(this, _SeedlessOnboardingController_instances, "m", _SeedlessOnboardingController_executeWithTokenRefresh).call(this, performFetch, 'fetchAllSecretData');
438
+ }, 'fetchAllSecretData');
442
439
  });
443
440
  }
444
441
  /**
@@ -634,7 +631,6 @@ class SeedlessOnboardingController extends base_controller_1.BaseController {
634
631
  */
635
632
  async checkIsPasswordOutdated(options) {
636
633
  const doCheckIsPasswordExpired = async () => {
637
- __classPrivateFieldGet(this, _SeedlessOnboardingController_instances, "m", _SeedlessOnboardingController_assertIsAuthenticatedUser).call(this, this.state);
638
634
  // cache result to reduce load on infra
639
635
  // Check cache first unless skipCache is true
640
636
  if (!options?.skipCache) {
@@ -647,6 +643,7 @@ class SeedlessOnboardingController extends base_controller_1.BaseController {
647
643
  return passwordOutdatedCache.isExpiredPwd;
648
644
  }
649
645
  }
646
+ __classPrivateFieldGet(this, _SeedlessOnboardingController_instances, "m", _SeedlessOnboardingController_assertIsAuthenticatedUser).call(this, this.state);
650
647
  const { nodeAuthTokens, authConnectionId, groupedAuthConnectionId, userId, } = this.state;
651
648
  const currentDeviceAuthPubKey = __classPrivateFieldGet(this, _SeedlessOnboardingController_instances, "m", _SeedlessOnboardingController_recoverAuthPubKey).call(this);
652
649
  let globalAuthPubKey = options?.globalAuthPubKey;
@@ -676,6 +673,26 @@ class SeedlessOnboardingController extends base_controller_1.BaseController {
676
673
  ? await doCheckIsPasswordExpired()
677
674
  : await __classPrivateFieldGet(this, _SeedlessOnboardingController_instances, "m", _SeedlessOnboardingController_withControllerLock).call(this, doCheckIsPasswordExpired), 'checkIsPasswordOutdated');
678
675
  }
676
+ /**
677
+ * Check if the user is authenticated with the seedless onboarding flow by checking the token values in the state.
678
+ *
679
+ * @returns True if the user is authenticated, false otherwise.
680
+ */
681
+ async checkIsSeedlessOnboardingUserAuthenticated() {
682
+ let isAuthenticated = false;
683
+ try {
684
+ __classPrivateFieldGet(this, _SeedlessOnboardingController_instances, "m", _SeedlessOnboardingController_assertIsAuthenticatedUser).call(this, this.state);
685
+ isAuthenticated =
686
+ Boolean(this.state.accessToken) && Boolean(this.state.refreshToken);
687
+ }
688
+ catch {
689
+ isAuthenticated = false;
690
+ }
691
+ this.update((state) => {
692
+ state.isSeedlessOnboardingUserAuthenticated = isAuthenticated;
693
+ });
694
+ return isAuthenticated;
695
+ }
679
696
  /**
680
697
  * Clears the current state of the SeedlessOnboardingController.
681
698
  */
@@ -716,11 +733,14 @@ class SeedlessOnboardingController extends base_controller_1.BaseController {
716
733
  async refreshAuthTokens() {
717
734
  __classPrivateFieldGet(this, _SeedlessOnboardingController_instances, "m", _SeedlessOnboardingController_assertIsAuthenticatedUser).call(this, this.state);
718
735
  const { refreshToken } = this.state;
736
+ const res = await __classPrivateFieldGet(this, _SeedlessOnboardingController_refreshJWTToken, "f").call(this, {
737
+ connection: this.state.authConnection,
738
+ refreshToken,
739
+ }).catch((error) => {
740
+ log('Error refreshing JWT tokens', error);
741
+ throw new Error(constants_1.SeedlessOnboardingControllerErrorMessage.FailedToRefreshJWTTokens);
742
+ });
719
743
  try {
720
- const res = await __classPrivateFieldGet(this, _SeedlessOnboardingController_refreshJWTToken, "f").call(this, {
721
- connection: this.state.authConnection,
722
- refreshToken,
723
- });
724
744
  const { idTokens, accessToken, metadataAccessToken } = res;
725
745
  // re-authenticate with the new id tokens to set new node auth tokens
726
746
  await this.authenticate({
@@ -731,6 +751,7 @@ class SeedlessOnboardingController extends base_controller_1.BaseController {
731
751
  authConnectionId: this.state.authConnectionId,
732
752
  groupedAuthConnectionId: this.state.groupedAuthConnectionId,
733
753
  userId: this.state.userId,
754
+ refreshToken,
734
755
  skipLock: true,
735
756
  });
736
757
  }
@@ -912,7 +933,7 @@ async function _SeedlessOnboardingController_submitGlobalPassword({ targetAuthPu
912
933
  __classPrivateFieldGet(this, _SeedlessOnboardingController_instances, "m", _SeedlessOnboardingController_setUnlocked).call(this);
913
934
  }
914
935
  catch (error) {
915
- if (__classPrivateFieldGet(this, _SeedlessOnboardingController_instances, "m", _SeedlessOnboardingController_isTokenExpiredError).call(this, error)) {
936
+ if (__classPrivateFieldGet(this, _SeedlessOnboardingController_instances, "m", _SeedlessOnboardingController_isAuthTokenError).call(this, error)) {
916
937
  throw error;
917
938
  }
918
939
  if (__classPrivateFieldGet(this, _SeedlessOnboardingController_instances, "m", _SeedlessOnboardingController_isMaxKeyChainLengthError).call(this, error)) {
@@ -968,7 +989,7 @@ async function _SeedlessOnboardingController_persistOprfKey(oprfKey, authPubKey)
968
989
  });
969
990
  }
970
991
  catch (error) {
971
- if (__classPrivateFieldGet(this, _SeedlessOnboardingController_instances, "m", _SeedlessOnboardingController_isTokenExpiredError).call(this, error)) {
992
+ if (__classPrivateFieldGet(this, _SeedlessOnboardingController_instances, "m", _SeedlessOnboardingController_isAuthTokenError).call(this, error)) {
972
993
  throw error;
973
994
  }
974
995
  log('Error persisting local encryption key', error);
@@ -1033,10 +1054,10 @@ async function _SeedlessOnboardingController_loadSeedlessEncryptionKey(encKey) {
1033
1054
  */
1034
1055
  async function _SeedlessOnboardingController_recoverEncKey(password) {
1035
1056
  __classPrivateFieldGet(this, _SeedlessOnboardingController_instances, "m", _SeedlessOnboardingController_assertIsAuthenticatedUser).call(this, this.state);
1036
- const { authConnectionId, groupedAuthConnectionId, userId } = this.state;
1057
+ const { nodeAuthTokens, authConnectionId, groupedAuthConnectionId, userId, } = this.state;
1037
1058
  try {
1038
1059
  const recoverEncKeyResult = await this.toprfClient.recoverEncKey({
1039
- nodeAuthTokens: this.state.nodeAuthTokens,
1060
+ nodeAuthTokens,
1040
1061
  password,
1041
1062
  authConnectionId,
1042
1063
  groupedAuthConnectionId,
@@ -1046,7 +1067,7 @@ async function _SeedlessOnboardingController_recoverEncKey(password) {
1046
1067
  }
1047
1068
  catch (error) {
1048
1069
  // throw token expired error for token refresh handler
1049
- if (__classPrivateFieldGet(this, _SeedlessOnboardingController_instances, "m", _SeedlessOnboardingController_isTokenExpiredError).call(this, error)) {
1070
+ if (__classPrivateFieldGet(this, _SeedlessOnboardingController_instances, "m", _SeedlessOnboardingController_isAuthTokenError).call(this, error)) {
1050
1071
  throw error;
1051
1072
  }
1052
1073
  throw errors_1.RecoveryError.getInstance(error);
@@ -1062,7 +1083,7 @@ async function _SeedlessOnboardingController_recoverEncKey(password) {
1062
1083
  }
1063
1084
  catch (error) {
1064
1085
  log('Error fetching secret data', error);
1065
- if (__classPrivateFieldGet(this, _SeedlessOnboardingController_instances, "m", _SeedlessOnboardingController_isTokenExpiredError).call(this, error)) {
1086
+ if (__classPrivateFieldGet(this, _SeedlessOnboardingController_instances, "m", _SeedlessOnboardingController_isAuthTokenError).call(this, error)) {
1066
1087
  throw error;
1067
1088
  }
1068
1089
  throw new Error(constants_1.SeedlessOnboardingControllerErrorMessage.FailedToFetchSecretMetadata);
@@ -1166,7 +1187,7 @@ async function _SeedlessOnboardingController_encryptAndStoreSecretData(params) {
1166
1187
  });
1167
1188
  }
1168
1189
  catch (error) {
1169
- if (__classPrivateFieldGet(this, _SeedlessOnboardingController_instances, "m", _SeedlessOnboardingController_isTokenExpiredError).call(this, error)) {
1190
+ if (__classPrivateFieldGet(this, _SeedlessOnboardingController_instances, "m", _SeedlessOnboardingController_isAuthTokenError).call(this, error)) {
1170
1191
  throw error;
1171
1192
  }
1172
1193
  log('Error encrypting and storing secret data backup', error);
@@ -1324,6 +1345,9 @@ async function _SeedlessOnboardingController_withPersistedSecretMetadataBackupsS
1324
1345
  async function _SeedlessOnboardingController_createNewVaultWithAuthData({ password, rawToprfEncryptionKey, rawToprfPwEncryptionKey, rawToprfAuthKeyPair, }) {
1325
1346
  __classPrivateFieldGet(this, _SeedlessOnboardingController_instances, "m", _SeedlessOnboardingController_assertIsAuthenticatedUser).call(this, this.state);
1326
1347
  const { revokeToken } = this.state;
1348
+ if (!revokeToken) {
1349
+ throw new Error(constants_1.SeedlessOnboardingControllerErrorMessage.InvalidRevokeToken);
1350
+ }
1327
1351
  const accessToken = await __classPrivateFieldGet(this, _SeedlessOnboardingController_instances, "m", _SeedlessOnboardingController_getAccessToken).call(this, password);
1328
1352
  const vaultData = {
1329
1353
  toprfAuthKeyPair: rawToprfAuthKeyPair,
@@ -1475,10 +1499,13 @@ async function _SeedlessOnboardingController_assertPasswordInSync(options) {
1475
1499
  { refreshToken, revokeToken },
1476
1500
  ];
1477
1501
  });
1478
- }, _SeedlessOnboardingController_isTokenExpiredError = function _SeedlessOnboardingController_isTokenExpiredError(error) {
1502
+ }, _SeedlessOnboardingController_isAuthTokenError = function _SeedlessOnboardingController_isAuthTokenError(error) {
1479
1503
  if (error instanceof toprf_secure_backup_1.TOPRFError) {
1504
+ return (
1480
1505
  // eslint-disable-next-line @typescript-eslint/no-unsafe-enum-comparison
1481
- return error.code === toprf_secure_backup_1.TOPRFErrorCode.AuthTokenExpired;
1506
+ error.code === toprf_secure_backup_1.TOPRFErrorCode.AuthTokenExpired ||
1507
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-enum-comparison
1508
+ error.code === toprf_secure_backup_1.TOPRFErrorCode.InvalidAuthToken);
1482
1509
  }
1483
1510
  return false;
1484
1511
  }, _SeedlessOnboardingController_isMaxKeyChainLengthError = function _SeedlessOnboardingController_isMaxKeyChainLengthError(error) {
@@ -1521,7 +1548,7 @@ async function _SeedlessOnboardingController_executeWithTokenRefresh(operation,
1521
1548
  }
1522
1549
  catch (error) {
1523
1550
  // Check if this is a token expiration error
1524
- if (__classPrivateFieldGet(this, _SeedlessOnboardingController_instances, "m", _SeedlessOnboardingController_isTokenExpiredError).call(this, error)) {
1551
+ if (__classPrivateFieldGet(this, _SeedlessOnboardingController_instances, "m", _SeedlessOnboardingController_isAuthTokenError).call(this, error)) {
1525
1552
  log(`Token expired during ${operationName}, attempting to refresh tokens`, error);
1526
1553
  try {
1527
1554
  // Refresh the tokens