Sha256: 7615953e75643029ebafb0a4b8a439f13f0b2a51d2635fc6c52461779fda923a
Contents?: true
Size: 663 Bytes
Versions: 9
Compression:
Stored size: 663 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 = IdentityAuth::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
9 entries across 9 versions & 1 rubygems