LoginEngine mod

Hi all,

I’ve looked thru the list and haven’t seen an answer for something I’m
looking to do.

I just started a new project and we’re used to always using a user’s
email address as the login. The LoginEngine, however, has a login
field. I started poking thru the engine code to see how hard this
might be to extend/override and it sorta looks like it might be a
little involved.

My original idea was just to extend the User model and assign the
email address to the login field behind the scenes. However, when I do
this the validation fails (obviously). The login field is pretty
critical to the whole structure and I was just wondering if someone
else has tried and succeeded with this?

tia,

  • jason

Jason L. wrote:

I just started a new project and we’re used to always using a user’s
email address as the login. The LoginEngine, however, has a login
field. I started poking thru the engine code to see how hard this
might be to extend/override and it sorta looks like it might be a
little involved.

I just created a user.rb file in my application models directory that
looks like this:

class User < ActiveRecord::Base
include LoginEngine::AuthenticatedUser
before_validation do |r|
r.login = r.email
end
end

Seems to be working well so far.

Eric

Ah, perfect. And apologies for posting to the dev list as I didn’t
see the users list.

Thx!

-jason