Last active
May 31, 2022 09:15
-
-
Save programmeruser2/c7f7826717e39adf108e49637eae8522 to your computer and use it in GitHub Desktop.
Decode JWT
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const decodeJwt = token => token.split('.').map((item,index) => index==2?item:JSON.parse(atob(item))); | |
const encodeJwt = segments => segments.map((item,index)=>index==2?item:btoa(JSON.stringify(item))).join('.'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Who are you and what are you trying to do