Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems mixing wizardly with authlogic #3

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

Problems mixing wizardly with authlogic #3

matellis opened this issue Oct 21, 2009 · 0 comments

Comments

@matellis
Copy link

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
Redoing my last pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant