devise_password_expirable 2.0.0 → 3.0.0
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
|
SHA1:
|
3
|
-
|
4
|
-
|
3
|
+
data.tar.gz: 2726a8b1db2a619b19446af74c92503f98445986
|
4
|
+
metadata.gz: 5df34d010a760f0510a04a13387afaf879a04b23
|
5
5
|
SHA512:
|
6
|
-
|
7
|
-
|
6
|
+
data.tar.gz: 28cf76d96e5e192e1521838b667050af3d0a6ac226ea215aaefda8f01d47c433f1a92acc64388263972d916f42e4682190dbefae88973af512a4d0bdc55ecf1d
|
7
|
+
metadata.gz: 955e4ffff91eec9e59d41e7b046a4fd24419ae9d7dc4017b8972848d5d5aecc01bea5838909e0f4f770cba78e64efafe7a26b772c4482ac4ff5785b0e6f04bc1
|
@@ -19,7 +19,7 @@ Gem::Specification.new do |s|
|
|
19
19
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
20
20
|
s.require_paths = ["lib"]
|
21
21
|
|
22
|
-
s.add_runtime_dependency 'rails', '>= 3.
|
22
|
+
s.add_runtime_dependency 'rails', '>= 3.2.22.2'
|
23
23
|
s.add_runtime_dependency 'devise', '>= 2.0.0.rc'
|
24
24
|
|
25
25
|
s.add_development_dependency 'bundler'
|
@@ -8,42 +8,40 @@ module DevisePasswordExpirable
|
|
8
8
|
end
|
9
9
|
|
10
10
|
# controller instance methods
|
11
|
-
|
12
|
-
private
|
11
|
+
private
|
13
12
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
end
|
13
|
+
# lookup if an password change needed
|
14
|
+
def handle_password_change
|
15
|
+
if not devise_controller? and not ignore_password_expire? and not request.format.nil? and request.format.html?
|
16
|
+
Devise.mappings.keys.flatten.any? do |scope|
|
17
|
+
if signed_in?(scope) and warden.session(scope)[:password_expired]
|
18
|
+
session["#{scope}_return_to"] = request.path if request.get?
|
19
|
+
redirect_for_password_change scope
|
20
|
+
return
|
23
21
|
end
|
24
22
|
end
|
25
23
|
end
|
24
|
+
end
|
26
25
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
# path for change password
|
33
|
-
def change_password_required_path_for(resource_or_scope = nil)
|
34
|
-
scope = Devise::Mapping.find_scope!(resource_or_scope)
|
35
|
-
change_path = "#{scope}_password_expired_path"
|
36
|
-
send(change_path)
|
37
|
-
end
|
38
|
-
|
39
|
-
protected
|
40
|
-
|
41
|
-
# allow to overwrite for some special handlings
|
42
|
-
def ignore_password_expire?
|
43
|
-
false
|
44
|
-
end
|
26
|
+
# redirect for password update with alert message
|
27
|
+
def redirect_for_password_change(scope)
|
28
|
+
redirect_to change_password_required_path_for(scope), :alert => I18n.t('change_required', {:scope => 'devise.password_expired'})
|
29
|
+
end
|
45
30
|
|
31
|
+
# path for change password
|
32
|
+
def change_password_required_path_for(resource_or_scope = nil)
|
33
|
+
scope = Devise::Mapping.find_scope!(resource_or_scope)
|
34
|
+
change_path = "#{scope}_password_expired_path"
|
35
|
+
send(change_path)
|
46
36
|
end
|
37
|
+
|
38
|
+
protected
|
39
|
+
|
40
|
+
# allow to overwrite for some special handlings
|
41
|
+
def ignore_password_expire?
|
42
|
+
false
|
43
|
+
end
|
44
|
+
|
47
45
|
end
|
48
46
|
end
|
49
47
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: devise_password_expirable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 3.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jenni Kissinger
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2016-05-
|
12
|
+
date: 2016-05-25 00:00:00 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -18,7 +18,7 @@ dependencies:
|
|
18
18
|
requirements:
|
19
19
|
- - ">="
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: 3.
|
21
|
+
version: 3.2.22.2
|
22
22
|
type: :runtime
|
23
23
|
version_requirements: *id001
|
24
24
|
- !ruby/object:Gem::Dependency
|
@@ -91,7 +91,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
91
91
|
requirements: []
|
92
92
|
|
93
93
|
rubyforge_project:
|
94
|
-
rubygems_version: 2.
|
94
|
+
rubygems_version: 2.6.4
|
95
95
|
signing_key:
|
96
96
|
specification_version: 4
|
97
97
|
summary: Expire passwords plugin for devise
|