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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4a269d39594fb817ba41d90c08145095269351da
4
- data.tar.gz: 037dd34adf758a1d08418fd8b3eee7e56c3f9d01
3
+ metadata.gz: 8b1bd7589ea55a7edd6e8e56d8579e88b52cc3f4
4
+ data.tar.gz: 5825a8e120345807f429e6993eccbc8732450dcb
5
5
  SHA512:
6
- metadata.gz: 88e384e31fc22e617fe52b18d5665c2fa86fd4b54fe480d7432006bf394a18a1957cfacb3e1d14a02f60bc0f81296641e82cc5eaa7d16400b3e41938caccaef8
7
- data.tar.gz: 70a6446e21bd45b6f4667acbcf74e4ba5aa8181aa62942b9c0410487f83fff8c054ea85c018b7f71548a10f563df86571607859516bce6a1940d6439ca8e5770
6
+ metadata.gz: 854f361e0e72086510e7a950682426988dec71f6638e5d02cb4e46d67c8748489a98c9a4e6a5d76314d3a8148d99450e4de83afff73ea5b7b9532fda96b78a6f
7
+ data.tar.gz: 773f51925ce47a1618224fb92abf4c39dfa826de45d1314a07e2a83085cb5317a347b3be568a28f2d3d8a554a9ebe0b5828be7f9d5eebb071780b055c135ff45
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- devise_security_extension (0.8.3)
4
+ devise_security_extension (0.8.4)
5
5
  devise (>= 2.0.0)
6
6
  rails (>= 3.1.1)
7
7
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.8.3
1
+ 0.9.1
@@ -11,7 +11,8 @@ class Devise::PasswordExpiredController < DeviseController
11
11
  end
12
12
 
13
13
  def update
14
- if resource.update_with_password(resource_params)
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.8.4"
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-03-28"
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.8.4
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-03-28 00:00:00.000000000 Z
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