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

Validation example throws exception due to validate function 3rd argument being a number and not object/table #70

Open
AlexeyAtIgloo opened this issue Sep 12, 2017 · 0 comments

Comments

@AlexeyAtIgloo
Copy link

Been playing around with guard examples and noticed the following:

Getting this exception:

2017/09/12 13:26:07 [error] 7#7: *5 lua entry thread aborted: runtime error: /usr/local/openresty/site/lualib/resty/jwt.lua:696: bad argument #1 to 'pairs' (table expected, got number)
stack traceback:
coroutine 0:
	[C]: in function 'pairs'
	/usr/local/openresty/site/lualib/resty/jwt.lua:696: in function 'validate_claims'
	/usr/local/openresty/site/lualib/resty/jwt.lua:728: in function 'verify'
	/usr/local/openresty/nginx/conf/lua/jwtguard.lua:13: in function </usr/local/openresty/nginx/conf/lua/jwtguard.lua:1>, client: ..., server: localhost, request: "GET /test/ HTTP/1.1", host: "..."

My token does not have any claim and seems like 3rd argument on below line causing this issue:
here

If 3rd argument removed, everything seems to work as expected.

Thanks for a great library!

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