Are the validations failing for your User
or UserSession
model? Or both?
For the User
model, ensure that you are calling acts_as_authentic
:
class User
acts_as_authentic
end
For the UserSession
model, ensure that you're inheriting from the Session
class:
class UserSession < Authlogic::Session::Base
end
As for customizing the error messages, you can use the i18n approach as detailed below. Or, for the User
model at least, you can do it in Ruby. See these Authlogic docs:
http://rdoc.info/github/binarylogic/authlogic/master/Authlogic/ActsAsAuthentic/Login/Config
http://rdoc.info/github/binarylogic/authlogic/master/Authlogic/ActsAsAuthentic/Password/Config
In those docs, you'll notice some methods beginning with "merge." Those should do the trick for you.
I couldn't find anything equivalent for the Session
class. The comment in this Stack Overflow question suggests that it doesn't exist:
Custom validation messages for Session model in Authlogic