Remember token is not required.

This commit is contained in:
José Valim
2012-03-30 09:05:58 +02:00
parent b59ce51760
commit f1ccaf86a4
3 changed files with 6 additions and 9 deletions

View File

@@ -54,7 +54,7 @@ module Devise
BLACKLIST_FOR_SERIALIZATION = [:encrypted_password, :reset_password_token, :reset_password_sent_at,
:remember_created_at, :sign_in_count, :current_sign_in_at, :last_sign_in_at, :current_sign_in_ip,
:last_sign_in_ip, :password_salt, :confirmation_token, :confirmed_at, :confirmation_sent_at,
:unconfirmed_email, :failed_attempts, :unlock_token, :locked_at, :authentication_token]
:remember_token, :unconfirmed_email, :failed_attempts, :unlock_token, :locked_at, :authentication_token]
included do
class_attribute :devise_modules, :instance_writer => false

View File

@@ -33,15 +33,12 @@ module Devise
before_create :generate_confirmation_token, :if => :confirmation_required?
after_create :send_on_create_confirmation_instructions, :if => :confirmation_required?
before_update :postpone_email_change_until_confirmation, :if => :postpone_email_change?
after_update :send_confirmation_instructions, :if => :reconfirmation_required?
after_update :send_confirmation_instructions, :if => :reconfirmation_required?
end
def self.required_fields(klass)
required_methods = [:confirmation_token, :confirmed_at, :confirmation_sent_at]
if klass.reconfirmable
required_methods << :unconfirmed_email
end
required_methods << :unconfirmed_email if klass.reconfirmable
required_methods
end

View File

@@ -42,7 +42,7 @@ module Devise
attr_accessor :remember_me, :extend_remember_period
def self.required_fields(klass)
[:remember_created_at, :remember_token]
[:remember_created_at]
end
# Generate a new remember token and save the record without validations
@@ -91,7 +91,7 @@ module Devise
protected
def generate_remember_token?
def generate_remember_token? #:nodoc:
respond_to?(:remember_token) && remember_expired?
end
@@ -114,7 +114,7 @@ module Devise
end
# Generate a token checking if one does not already exist in the database.
def remember_token
def remember_token #:nodoc:
generate_token(:remember_token)
end