Module: Authlogic::Session::Params

Included in:
Base
Defined in:
lib/authlogic/session/params.rb

Overview

Params

Tries to log the user in via params. Think about cookies and sessions. They are just hashes in your controller, so are params. People never look at params as an authentication option, but it can be useful for logging into private feeds. Logging in a user is as simple as:

http://www.domain.com?user_credentials=[insert remember token here]

The user_credentials is based on the name of your session, the above example assumes UserSession. Also, this can be modified via configuration.

Instance Method Summary collapse

Instance Method Details

#valid_params?Boolean

Tries to validate the session from information in the params token

Returns:

  • (Boolean)


13
14
15
16
17
18
19
20
# File 'lib/authlogic/session/params.rb', line 13

def valid_params?
  if params_credentials
    self.unauthorized_record = search_for_record("find_by_#{remember_token_field}", params_credentials)
    return valid?
  end
  
  false
end