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

Problems With OAuth Flow using Explicit API Version #96

Open
cole-meurer opened this issue Feb 27, 2020 · 0 comments
Open

Problems With OAuth Flow using Explicit API Version #96

cole-meurer opened this issue Feb 27, 2020 · 0 comments

Comments

@cole-meurer
Copy link
Contributor

cole-meurer commented Feb 27, 2020

The following functions dealing with the OAuth flow inserted the API version into the request url, but it seems this is not desired (as mentioned in a Shopify Partners blog post).
Shopify.OAuth.request_token/2

iex> shopify_domain
...> |> Shopify.session()
...> |> Shopify.OAuth.request_token(shopify_token)
{:error, %Shopify.Response{code: 303, data: nil, headers: ...}}

Shopify.OAuth.permission_url/2

iex> shopify_domain
...> |> Shopify.session()
...> |> Shopify.OAuth.permission_url(params)
"....myshopify.com/admin/api/#{api_version}/oauth/authorize?..."

This permission url lead to a "page not found" error.

My current workaround is to nullify the API version for these two functions:

session =
  shop_name
  |> Shopify.session()
  |> Shopify.Session.put_api_version(nil)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant