Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Validation errors "no credentials provided" before .valid? or .save #53

Open
shaicoleman opened this Issue · 0 comments

1 participant

@shaicoleman

AuthLogic doesn't behave like ActiveRecord.

With ActiveRecord, the @errors array is filled only after running .valid? or .save
With AuthLogic it is run automatically and there is no way to disable it.

AuthLogic will therefore mark the fields login and password as error. As these are added to the base errors, there's no way to clear those errors. This is especially an issue if AuthLogic is used in conjunction with Formtastic. In that case those fields will always be highlighted as errors.

AuthLogic shouldn't check for errors until the .valid? or .save methods are called.

To reproduce, modify the authlogic example as follows,
class UserSessionsController < ApplicationController
def new
@user_session = UserSession.new
raise @user_session.inspect # will always show an error
end
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.