Skip to content

Commit 451f7ec

Browse files
committed
Merge pull request #25 from homakov/patch-1
CSRF vulnerability, injecting state in session
2 parents 74a15ad + 80d75bf commit 451f7ec

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

lib/omniauth/strategies/oauth2.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,7 @@ def request_phase
4949
end
5050

5151
def authorize_params
52-
if options.authorize_params[:state].to_s.empty?
53-
options.authorize_params[:state] = SecureRandom.hex(24)
54-
end
52+
options.authorize_params[:state] = SecureRandom.hex(24)
5553
params = options.authorize_params.merge(options.authorize_options.inject({}){|h,k| h[k.to_sym] = options[k] if options[k]; h})
5654
if OmniAuth.config.test_mode
5755
@env ||= {}

0 commit comments

Comments
 (0)