Skip to content
Browse files

Remember token is not required.

  • Loading branch information...
1 parent b59ce51 commit f1ccaf86a4568dec52126cf7995e1966b7e067da @josevalim josevalim committed Mar 30, 2012
Showing with 6 additions and 9 deletions.
  1. +1 −1 lib/devise/models/authenticatable.rb
  2. +2 −5 lib/devise/models/confirmable.rb
  3. +3 −3 lib/devise/models/rememberable.rb
View
2 lib/devise/models/authenticatable.rb
@@ -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
View
7 lib/devise/models/confirmable.rb
@@ -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
View
6 lib/devise/models/rememberable.rb
@@ -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
@@ -91,7 +91,7 @@ def rememberable_options
protected
- def generate_remember_token?
+ def generate_remember_token? #:nodoc:
respond_to?(:remember_token) && remember_expired?
end
@@ -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

0 comments on commit f1ccaf8

Please sign in to comment.
Something went wrong with that request. Please try again.