devise 1.0.3 → 1.0.4
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 +6 -0
- data/lib/devise/hooks/rememberable.rb +3 -1
- data/lib/devise/schema.rb +6 -5
- data/lib/devise/strategies/authenticatable.rb +1 -1
- data/lib/devise/version.rb +1 -1
- data/test/models/confirmable_test.rb +1 -1
- data/test/rails_app/app/mongo_mapper/admin.rb +7 -3
- data/test/rails_app/app/mongo_mapper/user.rb +9 -3
- metadata +2 -2
data/CHANGELOG.rdoc
CHANGED
@@ -22,9 +22,11 @@ end
|
|
22
22
|
# Before logout hook to forget the user in the given scope, only if rememberable
|
23
23
|
# is activated for this scope. Also clear remember token to ensure the user
|
24
24
|
# won't be remembered again.
|
25
|
+
# Notice that we forget the user if the record is frozen. This usually means the
|
26
|
+
# user was just deleted.
|
25
27
|
Warden::Manager.before_logout do |record, warden, scope|
|
26
28
|
if record.respond_to?(:forget_me!)
|
27
|
-
record.forget_me!
|
29
|
+
record.forget_me! unless record.frozen?
|
28
30
|
warden.response.delete_cookie "remember_#{scope}_token"
|
29
31
|
end
|
30
32
|
end
|
data/lib/devise/schema.rb
CHANGED
@@ -9,12 +9,13 @@ module Devise
|
|
9
9
|
# * :null - When true, allow columns to be null.
|
10
10
|
# * :encryptor - The encryptor going to be used, necessary for setting the proper encrypter password length.
|
11
11
|
def authenticatable(options={})
|
12
|
-
null
|
13
|
-
|
12
|
+
null = options[:null] || false
|
13
|
+
default = options[:default]
|
14
|
+
encryptor = options[:encryptor] || (respond_to?(:encryptor) ? self.encryptor : :sha1)
|
14
15
|
|
15
|
-
apply_schema :email, String, :null => null
|
16
|
-
apply_schema :encrypted_password, String, :null => null, :limit => Devise::ENCRYPTORS_LENGTH[encryptor]
|
17
|
-
apply_schema :password_salt, String, :null => null
|
16
|
+
apply_schema :email, String, :null => null, :default => default
|
17
|
+
apply_schema :encrypted_password, String, :null => null, :default => default, :limit => Devise::ENCRYPTORS_LENGTH[encryptor]
|
18
|
+
apply_schema :password_salt, String, :null => null, :default => default
|
18
19
|
end
|
19
20
|
|
20
21
|
# Creates authentication_token.
|
data/lib/devise/version.rb
CHANGED
@@ -216,7 +216,7 @@ class ConfirmableTest < ActiveSupport::TestCase
|
|
216
216
|
Devise.confirm_within = 0.days
|
217
217
|
user = create_user
|
218
218
|
user.confirmation_sent_at = Date.today
|
219
|
-
assert_not user.active?
|
219
|
+
assert_not user.reload.active?
|
220
220
|
end
|
221
221
|
|
222
222
|
test 'should not be active without confirmation' do
|
@@ -1,9 +1,13 @@
|
|
1
1
|
class Admin
|
2
2
|
include MongoMapper::Document
|
3
|
-
|
4
|
-
devise :authenticatable, :timeoutable
|
3
|
+
devise :authenticatable, :registerable, :timeoutable
|
5
4
|
|
6
5
|
def self.find_for_authentication(conditions)
|
7
|
-
last(:conditions => conditions
|
6
|
+
last(:conditions => conditions)
|
7
|
+
end
|
8
|
+
|
9
|
+
def self.last(options={})
|
10
|
+
options.merge!(:order => 'email')
|
11
|
+
super options
|
8
12
|
end
|
9
13
|
end
|
@@ -1,8 +1,14 @@
|
|
1
1
|
class User
|
2
2
|
include MongoMapper::Document
|
3
3
|
key :created_at, DateTime
|
4
|
-
devise :authenticatable, :http_authenticatable, :confirmable, :recoverable,
|
5
|
-
:
|
6
|
-
:
|
4
|
+
devise :authenticatable, :http_authenticatable, :confirmable, :lockable, :recoverable,
|
5
|
+
:registerable, :rememberable, :timeoutable, :token_authenticatable,
|
6
|
+
:trackable, :validatable
|
7
7
|
# attr_accessible :username, :email, :password, :password_confirmation
|
8
|
+
|
9
|
+
def self.last(options={})
|
10
|
+
options.merge!(:order => 'email')
|
11
|
+
super options
|
12
|
+
end
|
13
|
+
|
8
14
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: devise
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- "Jos\xC3\xA9 Valim"
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2010-
|
13
|
+
date: 2010-03-03 00:00:00 +01:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|