#34 ✓resolved
Andrew Chung

Length validation overrides for login, password and email do not handle all cases

Reported by Andrew Chung | February 1st, 2009 @ 09:19 PM

I've noticed that if I try and override some of the length validation options through the use of any of the following parameters:

I can get an error of:

authlogic/vendor/rails/activerecord/lib/active_record/validations.rb:571:in `validates_length_of': Too many range options specified. Choose only one. (ArgumentError)

The error occurs in the orm_adapters/active_record_adapter/acts_as_authentic/credentials.rb file.

I believe the problem stems from RAILS not allowing more than 1 length validation constraint. i.e. using :maximum precludes the use of :minium, :in, :is, or :within. The same applies if you use any of the other length constraints.

It looks like auth_logic is only allowing the following rules:
login field: within
password_field: minimum
email_field: within

I think we can change this fairly easily by adding a check for any user specified length field overrides.

I'm including an attachment with the modified credentials.rb file.

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

Object based authentication solution that handles all of the non sense for you. It's as easy as ActiveRecord is with a database.

People watching this ticket