Skip to content

Commit b0904fa

Browse files
Seedless onboarding controller: Remove usage of Buffer (#6140)
## Explanation Remove usage of `Buffer` from `seedless-onboarding-controller`. <!-- 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? --> ## 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 --> ## Changelog <!-- THIS SECTION IS NO LONGER NEEDED. The process for updating changelogs has changed. Please consult the "Updating changelogs" section of the Contributing doc for more. --> ## 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
1 parent 836f300 commit b0904fa

File tree

1 file changed

+1
-1
lines changed
  • packages/seedless-onboarding-controller/src

1 file changed

+1
-1
lines changed

packages/seedless-onboarding-controller/src/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,6 @@ export function decodeJWTToken(token: string): DecodedBaseJWTToken {
3030
const payload = parts[1];
3131
// Add padding if needed for base64 decoding
3232
const paddedPayload = payload + '='.repeat((4 - (payload.length % 4)) % 4);
33-
const decoded = JSON.parse(Buffer.from(paddedPayload, 'base64').toString());
33+
const decoded = JSON.parse(bytesToUtf8(base64ToBytes(paddedPayload)));
3434
return decoded as DecodedBaseJWTToken;
3535
}

0 commit comments

Comments
 (0)