Skip to content

Commit

Permalink
Remove iat from options in this example. It is not used in `JWT.dec…
Browse files Browse the repository at this point in the history
…ode` and it is confusion in this example.
  • Loading branch information
kjwierenga committed Oct 9, 2015
1 parent 96c98ca commit 8a0a18b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ token = JWT.encode jti_payload, hmac_secret, 'HS256'

begin
# Add jti and iat to the validation to check if the token has been manipulated
decoded_token = JWT.decode token, hmac_secret, true, { 'iat' => iat, 'jti' => jti, :verify_jti => true, :algorithm => 'HS256' }
decoded_token = JWT.decode token, hmac_secret, true, { 'jti' => jti, :verify_jti => true, :algorithm => 'HS256' }
# Check if the JTI has already been used
rescue JWT::InvalidJtiError
# Handle invalid token, e.g. logout user or deny access
Expand Down

0 comments on commit 8a0a18b

Please sign in to comment.