GithubHelp home page GithubHelp logo

Comments (9)

jDeppen avatar jDeppen commented on May 27, 2024

Same issue here

from authlogic.

jDeppen avatar jDeppen commented on May 27, 2024

Okay here's what worked for me, you have to choose one field as login_field. This allows me to have both of these fields "email" and "login"

acts_as_authentic do |c|
 c.login_field = "email"
end

I also saw it like this if you don't have a block:

acts_as_authentic :login_field => "email"

from authlogic.

voxxit avatar voxxit commented on May 27, 2024

Well, the problem with this is, I want to have a login form that does both forms. There should be a way to run a simple query to the database for this? For instance, select * from the user table where the login = ? or email = ? and crypted_password = ?

from authlogic.

voxxit avatar voxxit commented on May 27, 2024

bump

from authlogic.

 avatar commented on May 27, 2024

Yes, look at the find_by_login method here in the docs:

http://authlogic.rubyforge.org/classes/Authlogic/Session/Password/Config.html#M000077

Hope that helps.

from authlogic.

kris avatar kris commented on May 27, 2024

@binarylogic - 404.

from authlogic.

 avatar commented on May 27, 2024

Sorry, I moved the documentation:

http://rdoc.info/rdoc/binarylogic/authlogic/blob/e44e1e35dbdb7d1ac1d5ec097f0e0cca307679f0/Authlogic/ActsAsAuthentic/Login/Config.html

from authlogic.

kylebragger avatar kylebragger commented on May 27, 2024

are you saying find_by_smart_case_login_field() needs to be overridden?

from authlogic.

scsmith avatar scsmith commented on May 27, 2024

@kylebragger - try something like this in your user sessions model

find_by_login_method :find_by_login_or_email

then in your user model you can do sometihng like this:

def self.find_by_login_or_email(login)
  find_by_smart_case_login_field(login) || find_by_email(login)
end

from authlogic.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.