From 7dabeb71032e56c0aba04521c5779ca887097eb1 Mon Sep 17 00:00:00 2001 From: Devix Rootix Date: Sat, 28 Oct 2023 21:36:18 +0500 Subject: [PATCH] fix(useJwt)!: rename `jwt_decode` to `jwtDecode` Renamed `jwt_decode` to `jwtDecode` for compatibility with `jwt-decode` package's [latest release](https://github.com/auth0/jwt-decode/pull/232) --- packages/integrations/useJwt/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/integrations/useJwt/index.ts b/packages/integrations/useJwt/index.ts index 02e6c6c753c..013affe564b 100644 --- a/packages/integrations/useJwt/index.ts +++ b/packages/integrations/useJwt/index.ts @@ -2,7 +2,7 @@ import type { ComputedRef } from 'vue-demi' import { computed } from 'vue-demi' import type { MaybeRefOrGetter } from '@vueuse/shared' import { toValue } from '@vueuse/shared' -import jwt_decode from 'jwt-decode' +import { jwtDecode } from 'jwt-decode'; import type { JwtDecodeOptions, JwtHeader, JwtPayload } from 'jwt-decode' export interface UseJwtOptions { @@ -44,7 +44,7 @@ export function useJwt< const decodeWithFallback = (encodedJwt: string, options?: JwtDecodeOptions): T | Fallback => { try { - return jwt_decode(encodedJwt, options) + return jwtDecode(encodedJwt, options) } catch (err) { onError?.(err)