Skip to content

Problems With OAuth Flow using Explicit API Version #96

@cole-meurer

Description

@cole-meurer

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions