Skip to content

Commit

Permalink
fix(useJwt)!: rename jwt_decode to jwtDecode
Browse files Browse the repository at this point in the history
Renamed `jwt_decode` to `jwtDecode` for compatibility with `jwt-decode` package's [latest release](auth0/jwt-decode#232)
  • Loading branch information
root5427 authored Oct 28, 2023
1 parent bacf402 commit 7dabeb7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/integrations/useJwt/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<Fallback> {
Expand Down Expand Up @@ -44,7 +44,7 @@ export function useJwt<

const decodeWithFallback = <T extends object>(encodedJwt: string, options?: JwtDecodeOptions): T | Fallback => {
try {
return jwt_decode<T>(encodedJwt, options)
return jwtDecode<T>(encodedJwt, options)
}
catch (err) {
onError?.(err)
Expand Down

0 comments on commit 7dabeb7

Please sign in to comment.