Skip to content
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

Update http_client.rb to fix detect_provider problem #469

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions lib/nylas/resources/auth.rb
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def detect_provider(params)
# @return [String] Updated list of parameters, including those specific to admin
# consent.
def build_query_with_admin_consent(config)
params = build_query(config)
params = build_http_query(config)

# Appends new params specific for admin consent.
params[:provider] = "microsoft"
Expand All @@ -135,7 +135,7 @@ def build_query_with_admin_consent(config)
# @return [String] Updated list of encoded parameters, including those specific
# to PKCE.
def build_query_with_pkce(config, secret_hash)
params = build_query(config)
params = build_http_query(config)

# Appends new PKCE specific params.
params[:code_challenge_method] = "s256"
Expand All @@ -151,7 +151,7 @@ def build_query_with_pkce(config, secret_hash)
def url_auth_builder(config)
builder = URI.parse(api_uri)
builder.path = "/v3/connect/auth"
builder.query = URI.encode_www_form(build_query(config)).gsub(/\+/, "%20")
builder.query = URI.encode_www_form(build_http_query(config)).gsub(/\+/, "%20")

builder
end
Expand All @@ -160,7 +160,7 @@ def url_auth_builder(config)
#
# @param config [Hash] Configuration for the query.
# @return [Hash] List of parameters to encode in the query.
def build_query(config)
def build_http_query(config)
params = {
client_id: config[:client_id],
redirect_uri: config[:redirect_uri],
Expand Down
Loading