Repository navigation
fix: token errors and refactors - #6998
Merged
Merged
Conversation
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
Contributor
Author
|
@metamaskbot publish-preview |
Contributor
|
Preview builds have been published. See these instructions for more information about preview builds. Expand for full list of packages and versions. |
himanshuchawla009
requested changes
Oct 30, 2025
Contributor
Author
|
@metamaskbot publish-preview |
Contributor
|
Preview builds have been published. See these instructions for more information about preview builds. Expand for full list of packages and versions. |
Contributor
Author
|
@metamaskbot publish-preview |
Contributor
|
Preview builds have been published. See these instructions for more information about preview builds. Expand for full list of packages and versions. |
…uthentication state
lwin-kyaw
force-pushed
the
fix/token-errors
branch
from
October 30, 2025 10:48
dc6dbaa to
bd9da90
Compare
Contributor
Author
|
@metamaskbot publish-preview |
Contributor
|
Preview builds have been published. See these instructions for more information about preview builds. Expand for full list of packages and versions. |
himanshuchawla009
requested changes
Oct 30, 2025
|
|
||
| - **BREAKING** Update `refreshToken` and `revokeToken` params as required in `Authenticate` method. ([#6998](https://github.com/MetaMask/core/pull/6998)) | ||
| - Refactor `refreshAuthTokens` method, separately catch refreshJWTToken and authenticate errors. ([#6998](https://github.com/MetaMask/core/pull/6998)) | ||
| - Bump `@metamask/toprf-secure-backup` package to `0.9.0`. ([#6998](https://github.com/MetaMask/core/pull/6998)) |
Contributor
There was a problem hiding this comment.
Suggested change
| - Bump `@metamask/toprf-secure-backup` package to `0.9.0`. ([#6998](https://github.com/MetaMask/core/pull/6998)) | |
| - Bump `@metamask/toprf-secure-backup` package to `0.10.0`. ([#6998](https://github.com/MetaMask/core/pull/6998)) |
himanshuchawla009
approved these changes
Oct 30, 2025
lwin-kyaw
added a commit
that referenced
this pull request
Oct 30, 2025
## Explanation <!-- Thanks for your contribution! Take a moment to answer these questions so that reviewers have the information they need to properly understand your changes: * What is the current state of things and why does it need to change? * What is the solution your changes offer and how does it work? * Are there any changes whose purpose might not obvious to those unfamiliar with the domain? * If your primary goal was to update one package but you found you had to update another one along the way, why did you do so? * If you had to upgrade a dependency, why did you do so? --> Major release of SeedlessOnboardingController v6 ~ - Added new public method, `checkIsSeedlessOnboardingUserAuthenticated` to validate the controller authenticate tokens state. ([#6998](#6998)) - **BREAKING** Update `refreshToken` and `revokeToken` params as required in `Authenticate` method. ([#6998](#6998)) - Refactor `refreshAuthTokens` method, separately catch refreshJWTToken and authenticate errors. ([#6998](#6998)) - Bump `@metamask/toprf-secure-backup` package to `0.10.0`. ([#6998](#6998)) - Fixed `Invalid Access Token` error during rehydration. ([#6998](#6998)) ## References <!-- Are there any issues that this pull request is tied to? Are there other links that reviewers should consult to understand these changes better? Are there client or consumer pull requests to adopt any breaking changes? For example: * Fixes #12345 * Related to #67890 --> * Fix: MetaMask/metamask-extension#37337 ## Checklist - [x] I've updated the test suite for new or updated code as appropriate - [x] I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate - [x] I've communicated my changes to consumers by [updating changelogs for packages I've changed](https://github.com/MetaMask/core/tree/main/docs/contributing.md#updating-changelogs), highlighting breaking changes as necessary - [x] I've prepared draft pull requests for clients and consumer packages to resolve any breaking changes <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Publishes monorepo 652.0.0 and releases `@metamask/seedless-onboarding-controller` v6.0.0 with a new auth check method, breaking auth parameter changes, token refresh refactor, dependency bump, and an access token fix. > > - **`@metamask/seedless-onboarding-controller` v6.0.0**: > - Added `checkIsSeedlessOnboardingUserAuthenticated`. > - BREAKING: `authenticate` now requires `refreshToken` and `revokeToken` params. > - Refactored `refreshAuthTokens` to separately handle refresh/auth errors. > - Bumped `@metamask/toprf-secure-backup` to `0.10.0`. > - Fixed `Invalid Access Token` during rehydration. > - **Monorepo**: > - Bumped root `version` to `652.0.0`. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 9851013. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Explanation
This PR fixes
Invalid AccessTokenissue for the Social login users and also includes the following changes ~refreshAuthTokensmethod, separately catchrefreshJWTTokenandauthenticateerrorscheckIsSeedlessOnboardingUserAuthenticated, to validate the authentication state and tokens.References
Checklist
Note
Refactors auth token handling with retry/refresh, adds
checkIsSeedlessOnboardingUserAuthenticated, makesauthenticaterequirerefreshTokenandrevokeToken, fixes access-token rehydration, and bumps@metamask/toprf-secure-backupto 0.10.0.checkIsSeedlessOnboardingUserAuthenticated()to validate/setisSeedlessOnboardingUserAuthenticated.authenticatenow requiresrefreshTokenandrevokeToken; state updated to persist them along withaccessToken/metadataAccessToken.#isAuthTokenError(handlesAuthTokenExpiredandInvalidAuthToken); wrap more ops with#executeWithTokenRefresh(e.g.,fetchAllSecretData).refreshAuthTokens()to separately handle refresh vs re-auth errors; introduceFailedToRefreshJWTTokenserror.#getAccessToken; vault/decrypt path now surfaces tokens via#unlockVaultAndGetVaultData.assertIsAuthUserInfoValid; tightenassertIsSeedlessOnboardingUserAuthenticatedto requirerevokeTokenandaccessToken.AuthenticatedUserDetailsto include requiredrevokeTokenandaccessToken.@metamask/toprf-secure-backupto0.10.0(and transitives).Written by Cursor Bugbot for commit 0d0db1a. This will update automatically on new commits. Configure here.