shopapp 0.2.01 → 0.2.02
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/controllers/auth_controller.rb +7 -1
- data/app/controllers/concerns/shoplift_client.rb +10 -1
- data/shopapp.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2ac7c546491b6d2b689f7a2c1182e530d2ffee16971333050e73530eb90a5e88
|
4
|
+
data.tar.gz: 18b9c09885fe035a3bff53b820988de310b6324400f123dfb5dec00224dcd7d7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fd0689ee1d9027eb3165ace0bfc481f3ae41ec02df3f74a428d6826b046f6e99ca84532d2d406cfb42a8e52070384d5e472ce762dce690b36886d2d6c72a5b35
|
7
|
+
data.tar.gz: 02e54b3306734c9aee98ad091a36d1fbcebed1258a846227e0695bdc88d7dacd78122524042b8fa5f383f85ce899906cbeb5b63340c07579adb252d2ff8d482d
|
@@ -3,8 +3,14 @@ class AuthController < ActionController::Base
|
|
3
3
|
protect_from_forgery with: :exception
|
4
4
|
|
5
5
|
def auth
|
6
|
+
local_redirect_uri = if Rails.configuration.settings['verify_auth_with_current_url']
|
7
|
+
"#{root_url}auth/"
|
8
|
+
else
|
9
|
+
Rails.configuration.settings['authlift_redirect_uri']
|
10
|
+
end
|
11
|
+
|
6
12
|
response = client.auth_code.get_token params[:code],
|
7
|
-
redirect_uri:
|
13
|
+
redirect_uri: local_redirect_uri,
|
8
14
|
scope: scope
|
9
15
|
self.session_cookie = response.token
|
10
16
|
previous_url = session[:previous_url]
|
@@ -42,12 +42,21 @@ module ShopliftClient
|
|
42
42
|
session["authlift_session_id"] = new_value
|
43
43
|
end
|
44
44
|
|
45
|
+
def local_authlift_redirect_uri
|
46
|
+
if respond_to? :app_authlift_redirect_uri
|
47
|
+
app_authlift_redirect_uri
|
48
|
+
else
|
49
|
+
Rails.configuration.settings['authlift_redirect_uri']
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
45
53
|
def redirect_unauthorized
|
46
54
|
return if performed?
|
47
55
|
session.clear
|
48
56
|
session[:previous_url] = request.fullpath
|
57
|
+
|
49
58
|
redirect_to client.auth_code.authorize_url(
|
50
|
-
redirect_uri:
|
59
|
+
redirect_uri: local_authlift_redirect_uri,
|
51
60
|
scope: scope)
|
52
61
|
end
|
53
62
|
|
data/shopapp.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'shopapp'
|
3
|
-
s.version = '0.2.
|
3
|
+
s.version = '0.2.02'
|
4
4
|
s.date = '2018-09-10'
|
5
5
|
s.summary = 'Do a shoplift.'
|
6
6
|
s.description = 'Ha! Art thou Bedlam? Dost thou thirst base Trojan, to have me fold up Parca\'s fatal web? Hence!\
|