We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
The following instructions apply for Clearance >= 0.11.0.
In your model:
class User < ActiveRecord::Base include Clearance::User def email_optional? true end def self.authenticate(username, password) return nil unless user = find_by_username(username) return user if user.authenticated?(password) end end
In app/controllers/application_controller.rb:
class ApplicationController < ActionController::Base include Clearance::Authentication def authenticate(params) User.authenticate(params[:session][:username], params[:session][:password]) end end