Sha256: 1a50ea9f1b668975b53da7b37756fd2fa7186a087e2f559c519de92500732b24
Contents?: true
Size: 656 Bytes
Versions: 20
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
20 entries across 20 versions & 1 rubygems