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](https://github.com/auth0/jwt-decode/releases/tag/v4.0.0)

Solves #3508
  • Loading branch information
root5427 committed Apr 3, 2024
1 parent 1558cd2 commit 6c196b4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/integrations/useJwt/index.ts
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 6c196b4

Please sign in to comment.