Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

decode jwt token without key

let b64DecodeUnicode = str =>
  decodeURIComponent(
    Array.prototype.map.call(atob(str), c =>
      '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2)
    ).join(''))

let parseJwt = token =>
  JSON.parse(
    b64DecodeUnicode(
      token.split('.')[1].replace('-', '+').replace('_', '/')
    )
  )
Comment

PREVIOUS NEXT
Code Example
Javascript :: lodash groupby return array 
Javascript :: find the second largest number in an array javascript 
Javascript :: getting started with react 
Javascript :: change form value dynamically angular 
Javascript :: how to make an object in javascript 
Javascript :: javascript struct 
Javascript :: modify array js 
Javascript :: jquery get last element with two class name 
Javascript :: Passing a state as a prop in react 
Javascript :: redis pub or sub nodejs 
Javascript :: Anonymous Functions with arguments in JavaScript 
Javascript :: react return value from component 
Javascript :: reactjs 
Javascript :: angular 14 new features 
Javascript :: frames[i] js 
Javascript :: add object to another object javascript 
Javascript :: npx vs npm 
Javascript :: noty js 
Javascript :: add new html from javascript 
Javascript :: regular expression 
Javascript :: map values js 
Javascript :: js define constant by element id 
Javascript :: onkeypress 
Javascript :: javascript promise async 
Javascript :: prisma database example 
Javascript :: calendar picker react js 
Javascript :: conditional style react 
Javascript :: toggle buttons angular styles 
Javascript :: what is a heap in javascript 
Javascript :: how to turn of autocomplete in react hook form material ui 
ADD CONTENT
Topic
Content
Source link
Name
6+4 =