app/controllers/authentication_controller.rb
# Verifies the user by checking their email and password or their username and password

Verifies the user by checking their email and password or their username and password
Verifies the user by checking their email and password or their username and password
def verify_user(username_or_email)
    password = params[:user][:password]
    if username_or_email.rindex('@')
      email=username_or_email
      user = User.authenticate_by_email(email, password)
    else
      username=username_or_email
      user = User.authenticate_by_username(username, password)
    end
    user
  end
def verify_user ( username_or_email ) password = params [ :user ] [ :password ] if username_or_email . rindex ( '@' ) email = username_or_email user = User . authenticate_by_email ( email , password ) else username = username_or_email user = User . authenticate_by_username ( username , password ) end user end
Verifies the user by checking their email and password or their username and password
Verifies the user by checking their email and password or their username and password
username_or_email
<not_specific>