shopify_app 4.2.3 → 4.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: ddbd9741f95afe5632284e5dd5b848785dbf0bab
4
+ data.tar.gz: 5e072af36eb888d8f0db9b77dbab40da44ea297e
5
+ SHA512:
6
+ metadata.gz: 9547655af229cd8f5a01a8864ddeec5d45d1a83ea987f1a6d0d6f9a4571d0fe40f00d547b233b0ae3d8a8b8732808ced4114754a99c96689bba513027c993968
7
+ data.tar.gz: 8a76f79fc656eaa394ff84dba2f79ded2c21b19bb2ca19c40d67b2e50a8271ed8689f503511e1ac78ed21666760888fcc9da862190a7a30a1f380fc8872d878a
@@ -1,5 +1,8 @@
1
1
  class ApplicationController < ActionController::Base
2
2
  protect_from_forgery
3
+
4
+ # It will re-login if a user tries to access the application from a different shop
5
+ # before_filter :login_again_if_different_shop
3
6
 
4
7
  # Ask shop to authorize app again if additional permissions are required
5
8
  # rescue_from ActiveResource::ForbiddenAccess do
@@ -44,7 +44,7 @@ class SessionsController < ApplicationController
44
44
  return unless params[:shop].present?
45
45
  name = params[:shop].to_s.strip
46
46
  name += '.myshopify.com' if !name.include?("myshopify.com") && !name.include?(".")
47
- name.sub('https://', '').sub('http://', '')
47
+ name.gsub!('https://', '').sub('http://', '')
48
48
 
49
49
  u = URI("http://#{name}")
50
50
  u.host.ends_with?("myshopify.com") ? u.host : nil
@@ -23,6 +23,12 @@ module ShopifyApp::LoginProtection
23
23
  def shop_session
24
24
  session[:shopify]
25
25
  end
26
+
27
+ def login_again_if_different_shop
28
+ if shop_session && params[:shop] && params[:shop].is_a?(String) && shop_session.url != params[:shop]
29
+ redirect_to login_path(shop: params[:shop])
30
+ end
31
+ end
26
32
 
27
33
  protected
28
34
 
@@ -2,7 +2,7 @@ require 'rails'
2
2
 
3
3
  class ShopifyApp::Railtie < ::Rails::Railtie
4
4
 
5
- config.before_configuration do
5
+ config.before_initialize do
6
6
  config.shopify = ShopifyApp.configuration
7
7
  end
8
8
 
@@ -1,3 +1,3 @@
1
1
  module ShopifyApp
2
- VERSION = "4.2.3"
2
+ VERSION = "4.4.0"
3
3
  end
data/shopify_app.gemspec CHANGED
@@ -15,7 +15,7 @@ Gem::Specification.new do |s|
15
15
  s.rubyforge_project = "shopify-api"
16
16
 
17
17
  s.add_runtime_dependency('rails', '>= 3.1', '< 5.0')
18
- s.add_runtime_dependency('shopify_api', '~> 3.0.0')
18
+ s.add_runtime_dependency('shopify_api', '~> 3.2.0')
19
19
  s.add_runtime_dependency('omniauth-shopify-oauth2', '1.1.2')
20
20
  s.add_runtime_dependency('less-rails-bootstrap', '~> 2.0')
21
21
 
metadata CHANGED
@@ -1,58 +1,52 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shopify_app
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.2.3
5
- prerelease:
4
+ version: 4.4.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - Shopify
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-12-04 00:00:00.000000000 Z
11
+ date: 2014-02-24 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: rails
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ! '>='
17
+ - - ">="
20
18
  - !ruby/object:Gem::Version
21
19
  version: '3.1'
22
- - - <
20
+ - - "<"
23
21
  - !ruby/object:Gem::Version
24
22
  version: '5.0'
25
23
  type: :runtime
26
24
  prerelease: false
27
25
  version_requirements: !ruby/object:Gem::Requirement
28
- none: false
29
26
  requirements:
30
- - - ! '>='
27
+ - - ">="
31
28
  - !ruby/object:Gem::Version
32
29
  version: '3.1'
33
- - - <
30
+ - - "<"
34
31
  - !ruby/object:Gem::Version
35
32
  version: '5.0'
36
33
  - !ruby/object:Gem::Dependency
37
34
  name: shopify_api
38
35
  requirement: !ruby/object:Gem::Requirement
39
- none: false
40
36
  requirements:
41
- - - ~>
37
+ - - "~>"
42
38
  - !ruby/object:Gem::Version
43
- version: 3.0.0
39
+ version: 3.2.0
44
40
  type: :runtime
45
41
  prerelease: false
46
42
  version_requirements: !ruby/object:Gem::Requirement
47
- none: false
48
43
  requirements:
49
- - - ~>
44
+ - - "~>"
50
45
  - !ruby/object:Gem::Version
51
- version: 3.0.0
46
+ version: 3.2.0
52
47
  - !ruby/object:Gem::Dependency
53
48
  name: omniauth-shopify-oauth2
54
49
  requirement: !ruby/object:Gem::Requirement
55
- none: false
56
50
  requirements:
57
51
  - - '='
58
52
  - !ruby/object:Gem::Version
@@ -60,7 +54,6 @@ dependencies:
60
54
  type: :runtime
61
55
  prerelease: false
62
56
  version_requirements: !ruby/object:Gem::Requirement
63
- none: false
64
57
  requirements:
65
58
  - - '='
66
59
  - !ruby/object:Gem::Version
@@ -68,65 +61,57 @@ dependencies:
68
61
  - !ruby/object:Gem::Dependency
69
62
  name: less-rails-bootstrap
70
63
  requirement: !ruby/object:Gem::Requirement
71
- none: false
72
64
  requirements:
73
- - - ~>
65
+ - - "~>"
74
66
  - !ruby/object:Gem::Version
75
67
  version: '2.0'
76
68
  type: :runtime
77
69
  prerelease: false
78
70
  version_requirements: !ruby/object:Gem::Requirement
79
- none: false
80
71
  requirements:
81
- - - ~>
72
+ - - "~>"
82
73
  - !ruby/object:Gem::Version
83
74
  version: '2.0'
84
75
  - !ruby/object:Gem::Dependency
85
76
  name: rake
86
77
  requirement: !ruby/object:Gem::Requirement
87
- none: false
88
78
  requirements:
89
- - - ! '>='
79
+ - - ">="
90
80
  - !ruby/object:Gem::Version
91
81
  version: '0'
92
82
  type: :development
93
83
  prerelease: false
94
84
  version_requirements: !ruby/object:Gem::Requirement
95
- none: false
96
85
  requirements:
97
- - - ! '>='
86
+ - - ">="
98
87
  - !ruby/object:Gem::Version
99
88
  version: '0'
100
89
  - !ruby/object:Gem::Dependency
101
90
  name: minitest
102
91
  requirement: !ruby/object:Gem::Requirement
103
- none: false
104
92
  requirements:
105
- - - ! '>='
93
+ - - ">="
106
94
  - !ruby/object:Gem::Version
107
95
  version: '0'
108
96
  type: :development
109
97
  prerelease: false
110
98
  version_requirements: !ruby/object:Gem::Requirement
111
- none: false
112
99
  requirements:
113
- - - ! '>='
100
+ - - ">="
114
101
  - !ruby/object:Gem::Version
115
102
  version: '0'
116
103
  - !ruby/object:Gem::Dependency
117
104
  name: mocha
118
105
  requirement: !ruby/object:Gem::Requirement
119
- none: false
120
106
  requirements:
121
- - - ! '>='
107
+ - - ">="
122
108
  - !ruby/object:Gem::Version
123
109
  version: '0'
124
110
  type: :development
125
111
  prerelease: false
126
112
  version_requirements: !ruby/object:Gem::Requirement
127
- none: false
128
113
  requirements:
129
- - - ! '>='
114
+ - - ">="
130
115
  - !ruby/object:Gem::Version
131
116
  version: '0'
132
117
  description: Creates a basic sessions controller for authenticating with your Shop
@@ -139,7 +124,7 @@ executables: []
139
124
  extensions: []
140
125
  extra_rdoc_files: []
141
126
  files:
142
- - .gitignore
127
+ - ".gitignore"
143
128
  - CHANGELOG
144
129
  - Gemfile
145
130
  - LICENSE
@@ -194,27 +179,26 @@ files:
194
179
  - test/test_helper.rb
195
180
  homepage: http://www.shopify.com/developers
196
181
  licenses: []
182
+ metadata: {}
197
183
  post_install_message:
198
184
  rdoc_options: []
199
185
  require_paths:
200
186
  - lib
201
187
  required_ruby_version: !ruby/object:Gem::Requirement
202
- none: false
203
188
  requirements:
204
- - - ! '>='
189
+ - - ">="
205
190
  - !ruby/object:Gem::Version
206
191
  version: '0'
207
192
  required_rubygems_version: !ruby/object:Gem::Requirement
208
- none: false
209
193
  requirements:
210
- - - ! '>='
194
+ - - ">="
211
195
  - !ruby/object:Gem::Version
212
196
  version: '0'
213
197
  requirements: []
214
198
  rubyforge_project: shopify-api
215
- rubygems_version: 1.8.23
199
+ rubygems_version: 2.2.0
216
200
  signing_key:
217
- specification_version: 3
201
+ specification_version: 4
218
202
  summary: This gem is used to get quickly started with the Shopify API
219
203
  test_files:
220
204
  - test/config/development_config_file.yml