Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crashes if payload is nil #36

Open
ghost opened this issue Aug 6, 2020 · 4 comments
Open

crashes if payload is nil #36

ghost opened this issue Aug 6, 2020 · 4 comments

Comments

@ghost
Copy link

ghost commented Aug 6, 2020

If the auth token is corrupt and the payload ends up being nil, the code crashes.

Line 766 of jwt.lua

local val = claim == str_const.full_obj and cjson_decode(jwt_json) or jwt_obj.payload[claim]

Should be

local val = claim == str_const.full_obj and cjson_decode(jwt_json) or (jwt_obj.payload and jwt_obj.payload[claim])

@cdbattags
Copy link
Owner

Feel free to open a PR!

@cdbattags
Copy link
Owner

Hi @fredhall! Would you be willing to add a PR? If not I could get to this in a couple weeks

@ghost
Copy link
Author

ghost commented Aug 12, 2020 via email

@cdbattags
Copy link
Owner

Hey @fredhall, poking you here. You able to work through how to submit a pull request?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant