mirror of
https://github.com/HoneyryderChuck/httpx.git
synced 2025-10-05 00:02:38 -04:00
Merge branch 'bugfix/issue-289' into 'master'
Fix OAuthSession#load returning when all inst_vars are assigned See merge request os85/httpx!321
This commit is contained in:
commit
2f513526d3
@ -60,16 +60,17 @@ module HTTPX
|
||||
end
|
||||
|
||||
def load(http)
|
||||
return unless @token_endpoint && @token_endpoint_auth_method && @grant_type && @scope
|
||||
return if @token_endpoint && @token_endpoint_auth_method && @grant_type && @scope
|
||||
|
||||
metadata = http.get("#{issuer}/.well-known/oauth-authorization-server").raise_for_status.json
|
||||
metadata = http.get("#{@issuer}/.well-known/oauth-authorization-server").raise_for_status.json
|
||||
|
||||
@token_endpoint = metadata["token_endpoint"]
|
||||
@scope = metadata["scopes_supported"]
|
||||
@grant_type = Array(metadata["grant_types_supported"]).find { |gr| SUPPORTED_GRANT_TYPES.include?(gr) }
|
||||
@token_endpoint_auth_method = Array(metadata["token_endpoint_auth_methods_supported"]).find do |am|
|
||||
@token_endpoint ||= metadata["token_endpoint"]
|
||||
@scope ||= metadata["scopes_supported"]
|
||||
@grant_type ||= Array(metadata["grant_types_supported"]).find { |gr| SUPPORTED_GRANT_TYPES.include?(gr) }
|
||||
@token_endpoint_auth_method ||= Array(metadata["token_endpoint_auth_methods_supported"]).find do |am|
|
||||
SUPPORTED_AUTH_METHODS.include?(am)
|
||||
end
|
||||
nil
|
||||
end
|
||||
|
||||
def merge(other)
|
||||
|
Loading…
x
Reference in New Issue
Block a user