-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Fix unknown pkce method error when configured #1747
Changes from 5 commits
8cbe710
ccc9773
4d5be91
f042917
d244e69
7e2bf4b
a8ba995
45494da
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 |
---|---|---|
|
@@ -12,6 +12,7 @@ def self.from_request(request, attributes = {}) | |
attributes.merge( | ||
name: error_name_for(request.error), | ||
exception_class: exception_class_for(request.error), | ||
translate_options: request.error.try(:translate_options), | ||
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. I was not completely confident what classes 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. Maybe there's a default that can be set? grab :translate_options or fallback to {} 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. I default it here in 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. More thinking of if the Error somehow doesn't derive from Doorkeeper::OAuth::Error, e.g., it comes from activerecord or something |
||
state: request.try(:state), | ||
redirect_uri: request.try(:redirect_uri), | ||
), | ||
|
@@ -33,7 +34,7 @@ def self.exception_class_for(error) | |
delegate :name, :description, :state, to: :@error | ||
|
||
def initialize(attributes = {}) | ||
@error = OAuth::Error.new(*attributes.values_at(:name, :state)) | ||
@error = OAuth::Error.new(*attributes.values_at(:name, :state, :translate_options)) | ||
@exception_class = attributes[:exception_class] | ||
@redirect_uri = attributes[:redirect_uri] | ||
@response_on_fragment = attributes[:response_on_fragment] | ||
|
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.
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.
I updated this message in 7e2bf4b