Skip to content

Commit 11f0dea

Browse files
committed
wip
1 parent e2e481a commit 11f0dea

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/shopify_api/auth/oauth.rb

+5-2
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,11 @@ class << self
1616
shop: String,
1717
redirect_path: String,
1818
is_online: T.nilable(T::Boolean),
19+
scope: AuthScopes,
1920
).returns(T::Hash[Symbol, T.any(String, SessionCookie)])
2021
end
21-
def begin_auth(shop:, redirect_path:, is_online: true) #
22+
def begin_auth(shop:, redirect_path:, is_online: true, scope: ShopifyAPI::Context.scope)
23+
binding.pry if scope.nil? || scope.to_a.empty?
2224
unless Context.setup?
2325
raise Errors::ContextNotSetupError, "ShopifyAPI::Context not setup, please call ShopifyAPI::Context.setup"
2426
end
@@ -28,9 +30,10 @@ def begin_auth(shop:, redirect_path:, is_online: true) #
2830

2931
cookie = SessionCookie.new(value: state, expires: Time.now + 60)
3032

33+
# binding.pry
3134
query = {
3235
client_id: ShopifyAPI::Context.api_key,
33-
scope: ShopifyAPI::Context.scope.to_s,
36+
scope: scope.to_s,
3437
redirect_uri: "#{ShopifyAPI::Context.host}#{redirect_path}",
3538
state: state,
3639
"grant_options[]": is_online ? "per-user" : "",

0 commit comments

Comments
 (0)