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 +4 -4
- data/lib/lockie/failure_app.rb +12 -5
- data/lib/lockie/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2da2a367021890a8009a299c6cefac92ca7d1fc055b897c8d2b0c4f3f0481cab
|
4
|
+
data.tar.gz: 53f535b09619b31b69c2ed14592651ab6d5838e47781cd759a4ef520332432fa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3c443dc6a9e865104f8d1795a4b6e46660a8eb6439da16d5950448d1a67382289a81775b2e5875150b160d6860718584fa6ad06f073b2ba0896e7fd3728f745b
|
7
|
+
data.tar.gz: 540634facbc3d3a5f8910794543a5e457317d887108e78b6d522a64c28ed9b348a767bfe8028f89a56a3d3e9654eee48cc086336aa69ad58ccbc8bc216fb3598
|
data/lib/lockie/failure_app.rb
CHANGED
@@ -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
|
data/lib/lockie/version.rb
CHANGED
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.
|
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:
|
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.
|
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
|