Skip to content

Commit c4335cc

Browse files
committed
FIX: Do not cause server error if OAuth2 callback phase fails
1 parent 1c56447 commit c4335cc

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/omniauth_open_id_connect.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ def id_token_info
8383
def callback_phase
8484
discover! if options[:discovery]
8585
oauth2_callback_phase = super
86+
return oauth2_callback_phase if env['omniauth.error']
87+
8688
if id_token_info["nonce"].empty? || id_token_info["nonce"] != session.delete("omniauth.nonce")
8789
return fail!(:csrf_detected, CallbackError.new(:csrf_detected, "CSRF detected"))
8890
end

0 commit comments

Comments
 (0)