Created
May 25, 2020 09:16
-
-
Save pirafrank/3b34ca10452e794b068a1dbd5e30d9f5 to your computer and use it in GitHub Desktop.
extract jwt body with no validation
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
# sometimes you only need to get JWT body data without validating it | |
# WARNING: use this only if you have already validated the token in earlier steps in the chain | |
const jwt = "eyJ0eX..."; | |
const jwtBodyJson = JSON.parse(Buffer.from(jwt.split(".")[1], "base64").toString()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment