Problems mixing wizardly with authlogic #3

Open
matellis opened this Issue Oct 21, 2009 · 0 comments

Comments

Projects
None yet
1 participant
@matellis

I'm using authlogic for my authentication plugin and have a three step wizard setup that sets up a a user that is acting as authentic with authlogic doing stuff behind the scenes like encrypting passwords, etc.

When the final step is completed and the FINISH button is pressed the User object is written to the database but it looks like authlogic hasn't had a chance to do it's stuff as various fields it populates are nil. The result is this error:

Mysql::Error: Column 'crypted_password' cannot be null: INSERT INTO 'users'

The bottom of the code stack looks like this:

(eval):52:in 'complete_wizard'
(eval):110:in 'step3'

After a lot of digging the crypted_password field is not being set as I've protected it in my model to prevent people setting up users using a URL (see http://b.lesseverything.com/2008/3/11/use-attr_protected-or-we-will-hack-you ).

Wizardly uses mass assignment to submit my final record and this conflicts with using attr_protected on some important user attributes. Can anyone recommend a work round so I can use wizardly, authlogic and attr_protected? I'm thinking - maybe a callback method that I can use in place of mass assignment so I can poke in the values into a new User object myself?

hewo pushed a commit to hewo/wizardly that referenced this issue Nov 1, 2011

Merge pull request #3 from mhuggins/master
Redoing my last pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment