Skip to content

Commit d414194

Browse files
committed
Fix rubocop warnings
1 parent 53ade6b commit d414194

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

lib/omniauth/strategies/oauth2.rb

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@ def self.inherited(subclass)
3535
:code_challenge => proc { |verifier|
3636
Base64.urlsafe_encode64(
3737
Digest::SHA2.digest(verifier),
38-
padding: false
38+
:padding => false,
3939
)
4040
},
41-
:code_challenge_method => "S256"
41+
:code_challenge_method => "S256",
4242
}
4343

4444
attr_accessor :access_token
@@ -59,7 +59,7 @@ def request_phase
5959
redirect client.auth_code.authorize_url({:redirect_uri => callback_url}.merge(authorize_params))
6060
end
6161

62-
def authorize_params
62+
def authorize_params# rubocop:disable Metrics/AbcSize, Metrics/MethodLength
6363
options.authorize_params[:state] = SecureRandom.hex(24)
6464

6565
if OmniAuth.config.test_mode
@@ -104,13 +104,14 @@ def callback_phase # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexi
104104

105105
def pkce_authorize_params
106106
return {} unless options.pkce
107+
107108
options.pkce_verifier = SecureRandom.hex(64)
108109

109110
# NOTE: see https://tools.ietf.org/html/rfc7636#appendix-A
110111
{
111112
:code_challenge => options.pkce_options[:code_challenge]
112113
.call(options.pkce_verifier),
113-
:code_challenge_method => options.pkce_options[:code_challenge_method]
114+
:code_challenge_method => options.pkce_options[:code_challenge_method],
114115
}
115116
end
116117

0 commit comments

Comments
 (0)