Skip to content

Commit

Permalink
Add unit test to reproduce #200
Browse files Browse the repository at this point in the history
  • Loading branch information
excpt committed Sep 2, 2017
1 parent d6dcd58 commit 33a93a8
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions spec/jwt_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -238,4 +238,14 @@
expect(JWT::Encode.base64url_encode('foo')).to eq('string-with_non-url-safe_characters_')
end
end

it 'should not verify token even if the payload has claims' do
head = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9'
load = 'eyJ1c2VyX2lkIjo1NCwiZXhwIjoxNTA0MzkwODA0fQ'
sign = 'Skpi6FfYMbZ-DwW9ocyRIosNMdPMAIWRLYxRO68GTQk'

expect do
JWT.decode([head, load, sign].join('.'), '', false)
end.not_to raise_error
end
end

0 comments on commit 33a93a8

Please sign in to comment.