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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 60b93c309ec47d8b932f06ba91255875d5c2ff5674218c7602532eb3b5c42baa
4
- data.tar.gz: 4aa50ec7b8174321676bb1b331f6ed2fe8c783e441d2b9c3126ba0596384c4f8
3
+ metadata.gz: 2ac7c546491b6d2b689f7a2c1182e530d2ffee16971333050e73530eb90a5e88
4
+ data.tar.gz: 18b9c09885fe035a3bff53b820988de310b6324400f123dfb5dec00224dcd7d7
5
5
  SHA512:
6
- metadata.gz: 808659fb8360689bcf614971378c48e792b0e8bb47eed0f86a39b8233d4e2dfdc6eee190f7a80a92bc10c064fec25c26babd8061fefa8a378059965ef538319c
7
- data.tar.gz: 41cf3d4673a47ce451ed48a7e79173bc8f2b7b02db0c26ef8d03b549f6d248cc39694d85d128cbad2f783cf5264e5a47dd38e267a428585146afc5c2bf0b7899
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: Rails.configuration.settings['authlift_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: Rails.configuration.settings['authlift_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.01'
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!\
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shopapp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.01
4
+ version: 0.2.02
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zeljko