Skip to content

Commit

Permalink
build(deps): Bump jwt-decode from 3.1.2 to 4.0.0 (#1258)
Browse files Browse the repository at this point in the history
* build(deps): Bump jwt-decode from 3.1.2 to 4.0.0

Bumps [jwt-decode](https://github.com/auth0/jwt-decode) from 3.1.2 to 4.0.0.
- [Release notes](https://github.com/auth0/jwt-decode/releases)
- [Changelog](https://github.com/auth0/jwt-decode/blob/main/CHANGELOG.md)
- [Commits](auth0/jwt-decode@v3.1.2...v4.0.0)

---
updated-dependencies:
- dependency-name: jwt-decode
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>

* fix: update JWT import for jwt-decode 4

* style: format JS

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Paul Schreiber <[email protected]>
  • Loading branch information
dependabot[bot] and paulschreiber authored Oct 31, 2023
1 parent 258c3d5 commit 2a2ceac
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 7 deletions.
16 changes: 12 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"i18next": "^23.6.0",
"i18next-browser-languagedetector": "^7.1.0",
"js-cookie": "^3.0.5",
"jwt-decode": "^3.1.2",
"jwt-decode": "^4.0.0",
"lodash": "^4.17.21",
"mapbox-gl": "^2.15.0",
"notistack": "^3.0.1",
Expand Down
7 changes: 5 additions & 2 deletions src/storyMap/components/StoryMapInvite.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* along with this program. If not, see https://www.gnu.org/licenses/.
*/
import { useCallback, useEffect, useMemo } from 'react';
import jwt from 'jwt-decode';
import { jwtDecode } from 'jwt-decode';
import { useTranslation } from 'react-i18next';
import { useDispatch, useSelector } from 'react-redux';
import { useNavigate, useSearchParams } from 'react-router-dom';
Expand All @@ -36,7 +36,10 @@ const StoryMapInvite = () => {
const { trackEvent } = useAnalytics();
const [searchParams] = useSearchParams();
const token = useMemo(() => searchParams.get('token'), [searchParams]);
const decodedToken = useMemo(() => (token ? jwt(token) : null), [token]);
const decodedToken = useMemo(
() => (token ? jwtDecode(token) : null),
[token]
);
const membershipId = useMemo(() => decodedToken.membershipId, [decodedToken]);
const { processing, success, error, storyMap } =
useSelector(state => state.storyMap.memberships.approve[membershipId]) ||
Expand Down

0 comments on commit 2a2ceac

Please sign in to comment.