Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ PATH
clerk-http-client (~> 2.0)
concurrent-ruby (~> 1.1)
faraday (>= 1.4.1, < 3.0)
jwt (~> 2.5)
jwt (~> 3.0)

GEM
remote: https://rubygems.org/
Expand Down Expand Up @@ -97,7 +97,7 @@ GEM
rdoc (>= 4.0.0)
reline (>= 0.4.2)
json (2.9.1)
jwt (2.10.1)
jwt (3.1.1)
base64
language_server-protocol (3.17.0.3)
lint_roller (1.1.0)
Expand Down
2 changes: 1 addition & 1 deletion clerk-sdk-ruby.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Gem::Specification.new do |spec|
spec.require_paths = ["lib"]

spec.add_dependency "faraday", ">= 1.4.1", "< 3.0"
spec.add_dependency "jwt", '~> 2.5'
spec.add_dependency "jwt", '~> 3.0'
spec.add_dependency "clerk-http-client", "~> 2.0"
spec.add_dependency "concurrent-ruby", "~> 1.1"

Expand Down
2 changes: 1 addition & 1 deletion lib/clerk/authenticate_request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ def verify_token(token, **opts)
sdk.verify_token(token, **opts)
rescue JWT::ExpiredSignature, JWT::InvalidIatError => e
raise e
rescue JWT::DecodeError, JWT::RequiredDependencyError => _
rescue JWT::DecodeError => _
false
end
end
Expand Down
5 changes: 0 additions & 5 deletions spec/clerk/authenticate_request_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -436,11 +436,6 @@
expect(instance.send(:verify_token, "invalid_token")).to be false
end

it "should return false if the token has a required dependency error" do
expect(sdk).to receive(:verify_token).and_raise(JWT::RequiredDependencyError)
expect(instance.send(:verify_token, "invalid_token")).to be false
end

it "should re-raise the error if the token is expired" do
expect(sdk).to receive(:verify_token).and_raise(JWT::ExpiredSignature)
expect { instance.send(:verify_token, "invalid_token") }.to raise_error(JWT::ExpiredSignature)
Expand Down