You must log in or register to comment.
- YourBestFriend@quokk.auEnglish2 days
No. It’s just a dot separated array of base64 encoded strings. You don’t need any fancy debug
const jwt = "PASTE_JWT_HERE"; const [header, payload] = jwt.split("."); const decode = (part) => JSON.parse( new TextDecoder().decode( Uint8Array.from( atob(part.replace(/-/g, "+").replace(/_/g, "/")), c => c.charCodeAt(0) ) ) ); console.log("Header:", decode(header)); console.log("Payload:", decode(payload));- pcouy@lemmy.pierre-couy.frEnglish2 days
For just the payload on bash :
echo "$TOKEN" | cut -d '.' -f2 | base64 --decode | jq -C .(the last pipe and jq command can be dropped if you don’t have it installed)
