Permalink
Browse files

improving documentation

  • Loading branch information...
1 parent 9b81060 commit ca384d13b6f041e3bbf2dab8628b9e79a6bdbd4d @croaky croaky committed Sep 29, 2009
Showing with 5 additions and 5 deletions.
  1. +3 −3 lib/clearance/authentication.rb
  2. +2 −2 lib/clearance/user.rb
@@ -5,18 +5,18 @@ def self.included(controller) # :nodoc:
controller.send(:include, InstanceMethods)
controller.extend(ClassMethods)
end
-
+
module ClassMethods
def self.extended(controller)
controller.helper_method :current_user, :signed_in?, :signed_out?
controller.hide_action :current_user, :current_user=,
:signed_in?, :signed_out?,
:sign_in, :sign_out,
:authenticate, :deny_access
-
+
end
end
-
+
module InstanceMethods
# User in the current cookie
#
View
@@ -101,13 +101,13 @@ def authenticated?(password)
encrypted_password == encrypt(password)
end
- # Remember me for a year.
+ # Set the remember token.
#
# @example
# user.remember_me!
# cookies[:remember_token] = {
# :value => user.remember_token,
- # :expires => user.remember_token_expires_at
+ # :expires => 1.year.from_now.utc
# }
def remember_me!
self.remember_token = encrypt("--#{Time.now.utc}--#{password}--")

0 comments on commit ca384d1

Please sign in to comment.