Skip to content

Commit b9e7a6c

Browse files
committed
fix rubocop vulnerabilities
1 parent 15c9c56 commit b9e7a6c

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

lib/code0/identities/provider/base_oauth.rb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,8 @@ def create_identity(*)
6868
end
6969

7070
def config
71-
if config_loader.is_a?(Proc)
72-
return config_loader.call
73-
end
71+
return config_loader.call if config_loader.is_a?(Proc)
72+
7473
config_loader
7574
end
7675
end

spec/code0/identities/provider/discord_spec.rb

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
RSpec.describe Code0::Identities::Provider::Discord do
44
subject(:service_response) do
55
described_class.new({
6-
redirect_uri: redirect_uri,
7-
client_id: client_id,
8-
client_secret: client_secret
9-
}).load_identity(code: code)
6+
redirect_uri: redirect_uri,
7+
client_id: client_id,
8+
client_secret: client_secret
9+
}).load_identity(code: code)
1010
end
1111

1212
let(:redirect_uri) { SecureRandom.hex }
@@ -66,18 +66,19 @@
6666

6767
context "when config is Proc" do
6868
subject(:service_response) do
69-
described_class.new(-> {{
70-
redirect_uri: redirect_uri,
71-
client_id: client_id,
72-
client_secret: client_secret
73-
}}).load_identity(code: code)
69+
described_class.new(lambda {
70+
{
71+
redirect_uri: redirect_uri,
72+
client_id: client_id,
73+
client_secret: client_secret
74+
}
75+
}).load_identity(code: code)
7476
end
77+
7578
it_behaves_like "when everything is valid"
7679
end
7780

78-
context 'when config is a hash' do
81+
context "when config is a hash" do
7982
it_behaves_like "when everything is valid"
8083
end
81-
82-
8384
end

0 commit comments

Comments
 (0)