Skip to content

Commit

Permalink
revert non callback addresses
Browse files Browse the repository at this point in the history
  • Loading branch information
nelsonwittwer committed Sep 21, 2022
1 parent 7f33814 commit 548736a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions lib/shopify_api/auth/oauth.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def begin_auth(shop:, redirect_path:, is_online: true)

query_string = URI.encode_www_form(query)

auth_route = "#{ShopifyAPI::Context.host_scheme}#{shop}/admin/oauth/authorize?#{query_string}"
auth_route = "https://#{shop}/admin/oauth/authorize?#{query_string}"
{ auth_route: auth_route, cookie: cookie }
end

Expand All @@ -63,8 +63,7 @@ def validate_auth_callback(cookies:, auth_query:)

# TODO: replace this call with the HTTP client once it is built
body = { client_id: Context.api_key, client_secret: Context.api_secret_key, code: auth_query.code }
response = HTTParty.post("https://#{auth_query.shop}/admin/oauth/access_token",
body: body)
response = HTTParty.post("https://#{auth_query.shop}/admin/oauth/access_token", body: body)
unless response.ok?
raise Errors::RequestAccessTokenError,
"Cannot complete OAuth process. Received a #{response.code} error while requesting access token."
Expand Down
2 changes: 1 addition & 1 deletion lib/shopify_api/clients/http_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def initialize(base_path:, session: nil)
session ||= Context.active_session
raise Errors::NoActiveSessionError, "No passed or active session" unless session

@base_uri = T.let("#{Context.host_scheme}#{session.shop}", String)
@base_uri = T.let("https://#{session.shop}", String)
@base_uri_and_path = T.let("#{@base_uri}#{base_path}", String)

user_agent_prefix = Context.user_agent_prefix.nil? ? "" : "#{Context.user_agent_prefix} | "
Expand Down

0 comments on commit 548736a

Please sign in to comment.