-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merge changes into official CoinGecko repo #1
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -63,6 +63,20 @@ def callback_url | |
options[:redirect_uri] || (full_host + callback_path) | ||
end | ||
|
||
def callback_phase | ||
if request.request_method.downcase.to_sym == :post | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
url = "#{callback_url}" | ||
if (code = request.params['code']) && (state = request.params['state']) | ||
url += "?code=#{CGI::escape(code)}" | ||
url += "&state=#{CGI::escape(state)}" | ||
url += "&user=#{CGI::escape(request.params['user'])}" if request.params['user'] | ||
end | ||
Comment on lines
+68
to
+73
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why are we attaching these params on the query params of the callback URI? 🤔 |
||
session.options[:drop] = true # Do not set a session cookie on this response | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why? |
||
return redirect url | ||
end | ||
super | ||
end | ||
|
||
private | ||
|
||
def new_nonce | ||
|
@@ -105,7 +119,7 @@ def verify_claims!(id_token) | |
verify_aud!(id_token) | ||
verify_iat!(id_token) | ||
verify_exp!(id_token) | ||
verify_nonce!(id_token) if id_token[:nonce_supported] | ||
# verify_nonce!(id_token) if id_token[:nonce_supported] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We need to figure out why this is done. We really shouldn't be disabling the nonce verification, as it would allow for replay attacks. |
||
end | ||
|
||
def verify_iss!(id_token) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need this
callback_phase
? What does it actually do? 🤔