lockie 0.5.2 → 0.5.3

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
  SHA256:
3
- metadata.gz: 27d5888160628cbede6cdddc542ea8f8638500e787f2eda93be425b1f556ab2e
4
- data.tar.gz: 5897d3386ab1e1e7834a6884a113684910eb1d083af02791e39bad53010fb98a
3
+ metadata.gz: 2da2a367021890a8009a299c6cefac92ca7d1fc055b897c8d2b0c4f3f0481cab
4
+ data.tar.gz: 53f535b09619b31b69c2ed14592651ab6d5838e47781cd759a4ef520332432fa
5
5
  SHA512:
6
- metadata.gz: 5a1d6bdc871802e2eea30cbafd49588e7c4f52299e270066239ff7fdc82d780a177890681437c57b186fbe25b20148e52002c4d2539a8dbe89d48247bc352fb7
7
- data.tar.gz: b99066c6de4ca0648ed2817681968109b9cdd2650f32c5d6c8ca981e2789d03a56932c09b8947166c9ddcecf4404ceb519e5c33697b06379a25bbbec13c6971b
6
+ metadata.gz: 3c443dc6a9e865104f8d1795a4b6e46660a8eb6439da16d5950448d1a67382289a81775b2e5875150b160d6860718584fa6ad06f073b2ba0896e7fd3728f745b
7
+ data.tar.gz: 540634facbc3d3a5f8910794543a5e457317d887108e78b6d522a64c28ed9b348a767bfe8028f89a56a3d3e9654eee48cc086336aa69ad58ccbc8bc216fb3598
@@ -33,21 +33,28 @@ module Lockie
33
33
  def html_response
34
34
  flash[type] = message if message
35
35
  self.status = 302
36
+
37
+ unauthenticated_path = if warden_options[:scope]
38
+ warden.config.dig(:scope_defaults, warden_options[:scope], :unauthenticated_path) || Lockie.config.unauthenticated_path
39
+ else
40
+ Lockie.config.unauthenticated_path
41
+ end
42
+
43
+ uri = URI(unauthenticated_path)
44
+
36
45
  if Lockie.config.callback_url
37
- uri = URI(warden_options[:unauthenticated_path] || Lockie.config.unauthenticated_path)
38
46
  # only add callback_url if original path is not the same with login path
39
47
  unless request.original_fullpath == uri.path
40
48
  callback_url = request.base_url + request.original_fullpath
41
49
  uri.query = (uri.query.to_s.split("&") << "callback_url=#{ callback_url }").join("&")
42
50
  end
43
- redirect_to uri.to_s
44
- else
45
- redirect_to Lockie.config.unauthenticated_path
46
51
  end
52
+
53
+ redirect_to uri.to_s
47
54
  end
48
55
 
49
56
  def message
50
- @message ||= request.env['warden.message']
57
+ @message ||= request.env['warden.message']
51
58
  end
52
59
 
53
60
  def warden_options
@@ -1,3 +1,3 @@
1
1
  module Lockie
2
- VERSION = '0.5.2'
2
+ VERSION = '0.5.3'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lockie
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.2
4
+ version: 0.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Melvin Sembrano
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-12-15 00:00:00.000000000 Z
11
+ date: 2023-10-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -135,7 +135,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
135
135
  - !ruby/object:Gem::Version
136
136
  version: '0'
137
137
  requirements: []
138
- rubygems_version: 3.3.26
138
+ rubygems_version: 3.4.10
139
139
  signing_key:
140
140
  specification_version: 4
141
141
  summary: Drop in password and JWT token authentication for Ruby on Rails