Skip to content

Commit

Permalink
fix rubocop vulnerabilities
Browse files Browse the repository at this point in the history
  • Loading branch information
Knerio committed Aug 25, 2024
1 parent 15c9c56 commit b9e7a6c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
5 changes: 2 additions & 3 deletions lib/code0/identities/provider/base_oauth.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,8 @@ def create_identity(*)
end

def config
if config_loader.is_a?(Proc)
return config_loader.call
end
return config_loader.call if config_loader.is_a?(Proc)

config_loader
end
end
Expand Down
25 changes: 13 additions & 12 deletions spec/code0/identities/provider/discord_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
RSpec.describe Code0::Identities::Provider::Discord do
subject(:service_response) do
described_class.new({
redirect_uri: redirect_uri,
client_id: client_id,
client_secret: client_secret
}).load_identity(code: code)
redirect_uri: redirect_uri,
client_id: client_id,
client_secret: client_secret
}).load_identity(code: code)
end

let(:redirect_uri) { SecureRandom.hex }
Expand Down Expand Up @@ -66,18 +66,19 @@

context "when config is Proc" do
subject(:service_response) do
described_class.new(-> {{
redirect_uri: redirect_uri,
client_id: client_id,
client_secret: client_secret
}}).load_identity(code: code)
described_class.new(lambda {
{
redirect_uri: redirect_uri,
client_id: client_id,
client_secret: client_secret
}
}).load_identity(code: code)
end

it_behaves_like "when everything is valid"
end

context 'when config is a hash' do
context "when config is a hash" do
it_behaves_like "when everything is valid"
end


end

0 comments on commit b9e7a6c

Please sign in to comment.