devise_security_extension 0.8.4 → 0.9.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/VERSION +1 -1
- data/app/controllers/devise/password_expired_controller.rb +2 -1
- data/devise_security_extension.gemspec +3 -2
- data/lib/devise_security_extension.rb +1 -0
- data/lib/devise_security_extension/models/database_authenticatable_patch.rb +26 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8b1bd7589ea55a7edd6e8e56d8579e88b52cc3f4
|
4
|
+
data.tar.gz: 5825a8e120345807f429e6993eccbc8732450dcb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 854f361e0e72086510e7a950682426988dec71f6638e5d02cb4e46d67c8748489a98c9a4e6a5d76314d3a8148d99450e4de83afff73ea5b7b9532fda96b78a6f
|
7
|
+
data.tar.gz: 773f51925ce47a1618224fb92abf4c39dfa826de45d1314a07e2a83085cb5317a347b3be568a28f2d3d8a554a9ebe0b5828be7f9d5eebb071780b055c135ff45
|
data/Gemfile.lock
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.9.1
|
@@ -11,7 +11,8 @@ class Devise::PasswordExpiredController < DeviseController
|
|
11
11
|
end
|
12
12
|
|
13
13
|
def update
|
14
|
-
|
14
|
+
resource.extend(Devise::Models::DatabaseAuthenticatablePatch)
|
15
|
+
if resource.update_with_password(params[resource_name])
|
15
16
|
warden.session(scope)['password_expired'] = false
|
16
17
|
set_flash_message :notice, :updated
|
17
18
|
sign_in scope, resource, :bypass => true
|
@@ -6,12 +6,12 @@
|
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "devise_security_extension"
|
9
|
-
s.version = "0.
|
9
|
+
s.version = "0.9.1"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib"]
|
13
13
|
s.authors = ["Marco Scholl", "Alexander Dreher"]
|
14
|
-
s.date = "2015-
|
14
|
+
s.date = "2015-04-02"
|
15
15
|
s.description = "An enterprise security extension for devise, trying to meet industrial standard security demands for web applications."
|
16
16
|
s.email = "team@phatworx.de"
|
17
17
|
s.extra_rdoc_files = [
|
@@ -45,6 +45,7 @@ Gem::Specification.new do |s|
|
|
45
45
|
"lib/devise_security_extension/models/security_questionable.rb",
|
46
46
|
"lib/devise_security_extension/models/session_limitable.rb",
|
47
47
|
"lib/devise_security_extension/orm/active_record.rb",
|
48
|
+
"lib/devise_security_extension/models/database_authenticatable_patch.rb",
|
48
49
|
"lib/devise_security_extension/patches.rb",
|
49
50
|
"lib/devise_security_extension/patches/confirmations_controller_captcha.rb",
|
50
51
|
"lib/devise_security_extension/patches/confirmations_controller_security_question.rb",
|
@@ -93,3 +93,4 @@ require 'devise_security_extension/rails'
|
|
93
93
|
require 'devise_security_extension/orm/active_record'
|
94
94
|
require 'devise_security_extension/models/old_password'
|
95
95
|
require 'devise_security_extension/models/security_question'
|
96
|
+
require 'devise_security_extension/models/database_authenticatable_patch'
|
@@ -0,0 +1,26 @@
|
|
1
|
+
module Devise
|
2
|
+
module Models
|
3
|
+
module DatabaseAuthenticatablePatch
|
4
|
+
def update_with_password(params, *options)
|
5
|
+
current_password = params.delete(:current_password)
|
6
|
+
|
7
|
+
new_password = params[:password]
|
8
|
+
new_password_confirmation = params[:password_confirmation]
|
9
|
+
|
10
|
+
result = if valid_password?(current_password) && new_password.present? && new_password_confirmation.present?
|
11
|
+
update_attributes(params, *options)
|
12
|
+
else
|
13
|
+
self.assign_attributes(params, *options)
|
14
|
+
self.valid?
|
15
|
+
self.errors.add(:current_password, current_password.blank? ? :blank : :invalid)
|
16
|
+
self.errors.add(:password, new_password.blank? ? :blank : :invalid)
|
17
|
+
self.errors.add(:password_confirmation, new_password_confirmation.blank? ? :blank : :invalid)
|
18
|
+
false
|
19
|
+
end
|
20
|
+
|
21
|
+
clean_up_passwords
|
22
|
+
result
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: devise_security_extension
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.9.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marco Scholl
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-
|
12
|
+
date: 2015-04-02 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -135,6 +135,7 @@ files:
|
|
135
135
|
- lib/devise_security_extension/hooks/expirable.rb
|
136
136
|
- lib/devise_security_extension/hooks/password_expirable.rb
|
137
137
|
- lib/devise_security_extension/hooks/session_limitable.rb
|
138
|
+
- lib/devise_security_extension/models/database_authenticatable_patch.rb
|
138
139
|
- lib/devise_security_extension/models/expirable.rb
|
139
140
|
- lib/devise_security_extension/models/old_password.rb
|
140
141
|
- lib/devise_security_extension/models/password_archivable.rb
|