shopify_app 7.2.5 → 7.2.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 73a13aa324e7251f1f84dad2ebf4fdecd17d9a90
4
- data.tar.gz: b202b5087f3bdc3e0e70010f1f3d3ac311a8ab79
3
+ metadata.gz: b9335f7bf026825facf051b989eea2e4b3e30e9e
4
+ data.tar.gz: c7ef43c749908fe81968378060687a6dd6621019
5
5
  SHA512:
6
- metadata.gz: 80c4a1fa400a9e664d8123038b221cc3602bbf4ea6c077fbd3f429a6df5c618e2ff35a46e670790fcfabf08aac4665fcca8e9008c2b8096327da08cfb49db553
7
- data.tar.gz: 062e0684614ed72ca775392ca7d97e9d0df6f1a6d47f99bf5267919025a99d18945efe2351b5ff0552c3db66e93b6e746a98f594116cddcae8536e544bb057f8
6
+ metadata.gz: 6f23af64be558128afc5e8ac8a6fd2db88d6048e684a1305ca03be2cba181756f2ad58a5df462f695bc8d85c530721b3852c65d3697f638e791a78b3b9dc8b07
7
+ data.tar.gz: d092113b766bf4fc2ae0e661ea50a1467284c7628a8fc5d1c4259e6c70ea48641de695d5051841cccac880d2284bd2be131f75114415f66adfe13b8d847e61af
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ 7.2.6
2
+ -----
3
+ * Update LoginProtection#fullpage_redirect_to to get shopify domain from session
4
+ [[#401]](https://github.com/Shopify/shopify_app/pull/401)
5
+
1
6
  7.2.5
2
7
  -----
3
8
  * Update LoginProtection.redirection_javascript to work with absolute URLS
data/README.md CHANGED
@@ -285,6 +285,12 @@ ShopifyApp.configure do |config|
285
285
  end
286
286
  ```
287
287
 
288
+ You also need to have write_script_tags permission in the config scope in order to add script tags automatically:
289
+
290
+ ```ruby
291
+ config.scope = '... , write_script_tags'
292
+ ```
293
+
288
294
  Scripttags are created in the same way as the Webhooks, with a background job which will create the required scripttags.
289
295
 
290
296
  If `src` responds to `call` its return value will be used as the scripttag's source. It will be called on scripttag creation and deletion.
@@ -339,7 +345,7 @@ forceRedirect: <%= Rails.env.development? || Rails.env.test? ? 'false' : 'true'
339
345
  App Tunneling
340
346
  -------------
341
347
 
342
- For certain features like Application Proxy or Webhooks to receive requests from Shopify, your app needs to be on a publicly visible URL. This can be a hurdle during development or testing on a local machine. Fortunately, this can be overcome by employing a tunneling service like [Forward](https://forwardhq.com/), [RequestBin](requestb.in/), [ngrok](https://ngrok.com/) etc. These tools allow you to create a secure tunnel from the public Internet to your local machine.
348
+ For certain features like Application Proxy or Webhooks to receive requests from Shopify, your app needs to be on a publicly visible URL. This can be a hurdle during development or testing on a local machine. Fortunately, this can be overcome by employing a tunneling service like [Forward](https://forwardhq.com/), [RequestBin](https://requestb.in/), [ngrok](https://ngrok.com/) etc. These tools allow you to create a secure tunnel from the public Internet to your local machine.
343
349
 
344
350
  Tunneling is also useful for working the the embedded app sdk to solve mixed content issues since most tunnles provide ssl.
345
351
 
@@ -2,6 +2,8 @@ module ShopifyApp
2
2
  module LoginProtection
3
3
  extend ActiveSupport::Concern
4
4
 
5
+ class ShopifyDomainNotFound < StandardError; end
6
+
5
7
  included do
6
8
  rescue_from ActiveResource::UnauthorizedAccess, :with => :close_session
7
9
  end
@@ -86,7 +88,7 @@ module ShopifyApp
86
88
  message: 'Shopify.API.remoteRedirect',
87
89
  data: { location: normalizedLink.href }
88
90
  });
89
- window.parent.postMessage(data, "https://#{sanitized_shop_name}");
91
+ window.parent.postMessage(data, "https://#{current_shopify_domain}");
90
92
  }
91
93
 
92
94
  </script>
@@ -97,6 +99,13 @@ module ShopifyApp
97
99
  )
98
100
  end
99
101
 
102
+ def current_shopify_domain
103
+ shopify_domain = sanitized_shop_name || session[:shopify_domain]
104
+ return shopify_domain if shopify_domain.present?
105
+
106
+ raise ShopifyDomainNotFound
107
+ end
108
+
100
109
  def sanitized_shop_name
101
110
  @sanitized_shop_name ||= sanitize_shop_param(params)
102
111
  end
@@ -1,3 +1,3 @@
1
1
  module ShopifyApp
2
- VERSION = '7.2.5'
2
+ VERSION = '7.2.6'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shopify_app
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.2.5
4
+ version: 7.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shopify
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-02-27 00:00:00.000000000 Z
11
+ date: 2017-04-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails