devise 1.3.1 → 1.3.2
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of devise might be problematic. Click here for more details.
- data/CHANGELOG.rdoc +5 -0
- data/Gemfile.lock +1 -1
- data/lib/devise/models/recoverable.rb +3 -2
- data/lib/devise/version.rb +1 -1
- data/test/models/recoverable_test.rb +7 -0
- metadata +4 -4
data/CHANGELOG.rdoc
CHANGED
data/Gemfile.lock
CHANGED
@@ -42,6 +42,7 @@ module Devise
|
|
42
42
|
# Checks if the reset password token sent is within the limit time.
|
43
43
|
# We do this by calculating if the difference between today and the
|
44
44
|
# sending date does not exceed the confirm in time configured.
|
45
|
+
# Returns true if the ressource is not responding to reset_password_sent_at at all.
|
45
46
|
# reset_password_within is a model configuration, must always be an integer value.
|
46
47
|
#
|
47
48
|
# Example:
|
@@ -59,8 +60,8 @@ module Devise
|
|
59
60
|
# reset_password_period_valid? # will always return false
|
60
61
|
#
|
61
62
|
def reset_password_period_valid?
|
62
|
-
respond_to?(:reset_password_sent_at)
|
63
|
-
|
63
|
+
return true unless respond_to?(:reset_password_sent_at)
|
64
|
+
reset_password_sent_at && reset_password_sent_at.utc >= self.class.reset_password_within.ago
|
64
65
|
end
|
65
66
|
|
66
67
|
protected
|
data/lib/devise/version.rb
CHANGED
@@ -204,4 +204,11 @@ class RecoverableTest < ActiveSupport::TestCase
|
|
204
204
|
user.reload
|
205
205
|
assert_not_nil user.reset_password_token
|
206
206
|
end
|
207
|
+
|
208
|
+
test 'should have valid period if does not respond to reset_password_sent_at' do
|
209
|
+
user = create_user
|
210
|
+
user.stubs(:respond_to?).with(:reset_password_sent_at).returns(false)
|
211
|
+
assert user.reset_password_period_valid?
|
212
|
+
end
|
213
|
+
|
207
214
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: devise
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 31
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 3
|
9
|
-
-
|
10
|
-
version: 1.3.
|
9
|
+
- 2
|
10
|
+
version: 1.3.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- "Jos\xC3\xA9 Valim"
|
@@ -16,7 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2011-04-
|
19
|
+
date: 2011-04-21 00:00:00 +02:00
|
20
20
|
default_executable:
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|