From 4956cdb05437f02a727011fb44b32fbef63a41ba Mon Sep 17 00:00:00 2001
From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com>
Date: Thu, 18 Apr 2024 00:18:37 +0000
Subject: [PATCH] fix(deps): update dependency jwt-decode to v4 (#5264)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)
This PR contains the following updates:
| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [jwt-decode](https://togithub.com/auth0/jwt-decode) | [`^3.1.2` ->
`^4.0.0`](https://renovatebot.com/diffs/npm/jwt-decode/3.1.2/4.0.0) |
[![age](https://developer.mend.io/api/mc/badges/age/npm/jwt-decode/4.0.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/jwt-decode/4.0.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/jwt-decode/3.1.2/4.0.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/jwt-decode/3.1.2/4.0.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
---
### Release Notes
auth0/jwt-decode (jwt-decode)
###
[`v4.0.0`](https://togithub.com/auth0/jwt-decode/blob/HEAD/CHANGELOG.md#Version-400)
[Compare
Source](https://togithub.com/auth0/jwt-decode/compare/v3.1.2...v4.0.0)
[Full
Changelog](https://togithub.com/auth0/jwt-decode/compare/v3.1.2..v4.0.0)
A new version of the library, including a couple of improvements:
- No longer include a polyfill for
[atob](https://developer.mozilla.org/en-US/docs/Web/API/atob), as this
is [supported in all major browsers](https://caniuse.com/?search=atob)
(and [node environments >
14](https://developer.mozilla.org/en-US/docs/Web/API/atob#browser_compatibility)).
- Compile to ES2017, dropping support for anything that does not support
ES2017 (which should be very limited [according to
caniuse](https://caniuse.com/?search=es2017))
- Use Node's atob when running on node.
- Drop support for Node 14 and 16, add support for Node 20.
- Add support for package.json's `exports` field, for better CJS/ESM
support
- Reorganize build artifacts for better CJS/ESM support (cjs and esm
needs to be their own directory with a cjs specific package.json file)
- Drop manual UMD bundle creation in `index.standalone.ts`, but rely on
rollup instead.
- Infer JwtPayload and JwtHeader default types from the `header`
argument by using overloads.
Even though some users might experience breaking changes, mostly because
of the `exports` field, the majority should be able to update without
making any changes, assuming the SDK is used in environments with
support for `atob`.
##### Migration to v4.0.0
The `jwtDecode` function is now no longer the default export, and is
instead provided as a named export. Make sure to update your code in
places where you are importing this function:
```diff
-import jwtDecodefrom "jwt-decode";
+import { jwtDecode } from "jwt-decode";
```
---
### Configuration
📅 **Schedule**: Branch creation - "after 5pm,every weekend" in timezone
America/Los_Angeles, Automerge - "after 5pm,every weekend" in timezone
America/Los_Angeles.
🚦 **Automerge**: Enabled.
â™» **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.
🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.
---
- [ ] If you want to rebase/retry this PR, check
this box
---
This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/valora-inc/wallet).
---------
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Satish Ravi
---
package.json | 2 +-
src/keylessBackup/web3auth.ts | 8 ++++----
yarn.lock | 8 ++++----
3 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/package.json b/package.json
index 96cad3510c8..eea254c2f19 100644
--- a/package.json
+++ b/package.json
@@ -138,7 +138,7 @@
"intl-pluralrules": "^2.0.1",
"io-ts": "2.0.1",
"is-ip": "^3.1.0",
- "jwt-decode": "^3.1.2",
+ "jwt-decode": "^4.0.0",
"lodash": "^4.17.21",
"lottie-react-native": "^5.1.6",
"node-libs-react-native": "^1.2.1",
diff --git a/src/keylessBackup/web3auth.ts b/src/keylessBackup/web3auth.ts
index 8b313fc2045..674c0fab47d 100644
--- a/src/keylessBackup/web3auth.ts
+++ b/src/keylessBackup/web3auth.ts
@@ -1,8 +1,8 @@
-import jwtDecode from 'jwt-decode'
-import Logger from 'src/utils/Logger'
-import { TORUS_NETWORK, WEB3AUTH_CLIENT_ID } from 'src/config'
-import Torus from '@toruslabs/torus.js'
import NodeDetailManager from '@toruslabs/fetch-node-details'
+import Torus from '@toruslabs/torus.js'
+import { jwtDecode } from 'jwt-decode'
+import { TORUS_NETWORK, WEB3AUTH_CLIENT_ID } from 'src/config'
+import Logger from 'src/utils/Logger'
const TAG = 'keylessBackup/torus'
diff --git a/yarn.lock b/yarn.lock
index 955aff313fe..8b1e8741eef 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -12196,10 +12196,10 @@ jwt-decode@^2.2.0:
resolved "https://registry.yarnpkg.com/jwt-decode/-/jwt-decode-2.2.0.tgz#7d86bd56679f58ce6a84704a657dd392bba81a79"
integrity sha512-86GgN2vzfUu7m9Wcj63iUkuDzFNYFVmjeDm2GzWpUk+opB0pEpMsw6ePCMrhYkumz2C1ihqtZzOMAg7FiXcNoQ==
-jwt-decode@^3.1.2:
- version "3.1.2"
- resolved "https://registry.yarnpkg.com/jwt-decode/-/jwt-decode-3.1.2.tgz#3fb319f3675a2df0c2895c8f5e9fa4b67b04ed59"
- integrity sha512-UfpWE/VZn0iP50d8cz9NrZLM9lSWhcJ+0Gt/nm4by88UL+J1SiKN8/5dkjMmbEzwL2CAe+67GsegCbIKtbp75A==
+jwt-decode@^4.0.0:
+ version "4.0.0"
+ resolved "https://registry.yarnpkg.com/jwt-decode/-/jwt-decode-4.0.0.tgz#2270352425fd413785b2faf11f6e755c5151bd4b"
+ integrity sha512-+KJGIyHgkGuIq3IEBNftfhW/LfWhXUIY6OmyVWjliu5KH1y0fw7VQ8YndE2O4qZdMSd9SqbnC8GOcZEy0Om7sA==
keccak256@^1.0.0:
version "1.0.6"