Module | Authlogic::Session::Foundation::InstanceMethods |
In: |
lib/authlogic/session/foundation.rb
|
Set your credentials before you save your session. You can pass a hash of credentials:
session.credentials = {:login => "my login", :password => "my password", :remember_me => true}
or you can pass an array of objects:
session.credentials = [my_user_object, true]
and if you need to set an id, just pass it last. This value need be the last item in the array you pass, since the id is something that you control yourself, it should never be set from a hash or a form. Examples:
session.credentials = [{:login => "my login", :password => "my password", :remember_me => true}, :my_id] session.credentials = [my_user_object, true, :my_id]