Sha256: d1b9c695d61afb05bfeee96e179cee8346fdf76998d1e8d24f8b3c68f9521426
Contents?: true
Size: 656 Bytes
Versions: 11
Compression:
Stored size: 656 Bytes
Contents
module ShopifyCli module Tasks class EnsureLoopbackURL < ShopifyCli::Task def call(ctx) @ctx = ctx api_key = Project.current.env.api_key result = ShopifyCli::PartnersAPI.query(ctx, "get_app_urls", apiKey: api_key) loopback = OAuth::REDIRECT_HOST app = result["data"]["app"] urls = app["redirectUrlWhitelist"] if urls.grep(/#{loopback}/).empty? with_loopback = urls.push(loopback) ShopifyCli::PartnersAPI.query(@ctx, "update_dashboard_urls", input: { redirectUrlWhitelist: with_loopback, apiKey: api_key }) end end end end end
Version data entries
11 entries across 11 versions & 1 rubygems