Skip to content

Commit

Permalink
Remember token is not required.
Browse files Browse the repository at this point in the history
  • Loading branch information
José Valim committed Mar 30, 2012
1 parent b59ce51 commit f1ccaf8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
2 changes: 1 addition & 1 deletion lib/devise/models/authenticatable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ module Authenticatable
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
Expand Down
7 changes: 2 additions & 5 deletions lib/devise/models/confirmable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,12 @@ module Confirmable
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

Expand Down
6 changes: 3 additions & 3 deletions lib/devise/models/rememberable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ module Rememberable
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
Expand Down Expand Up @@ -91,7 +91,7 @@ def rememberable_options

protected

def generate_remember_token?
def generate_remember_token? #:nodoc:
respond_to?(:remember_token) && remember_expired?
end

Expand All @@ -114,7 +114,7 @@ def serialize_from_cookie(id, remember_token)
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

Expand Down

0 comments on commit f1ccaf8

Please sign in to comment.