Ruby on Rails
Sunday, October 31, 2010
On 31 Oct 2010, at 22:52, Colin Law wrote:
I'm working on my first Rails app and I have a question regardingauthentication. I already have authentication for signing up, loggingin, logging out, etc. What I need is an account email activationfunction and a reset password (forgot password) function. I have reada little bit about Devise and watched the Railscast episodes on it, itseems nice, but is it possible to add just the functions I mentioned?And do I need to change a lot in my current models to do it? Or is iteasier to do it manually?From the Devise documentation at github(http://github.com/plataformatec/devise):It's composed of 12 modules:...• Confirmable: sends emails with confirmation instructions and verifieswhether an account is already confirmed during sign in.• Recoverable: resets the user password and sends reset instructions....So you'll need to add "confirmable" and "recoverable" to your devisesettings and then add several fields to the existing database tables:confirmation_token, confirmed_at, confirmation_sent_atandreset_password_tokenAll of this is just a matter of quickly reading through the Devise sourcecode and the docs on github. It's there in plain sight.
I may be misinterpreting the original post, but I suspect he is not
actually using Devise at the moment.
Ah yes, shouldn't be skimming mails this late in the evening :-).
To the original poster:
You have two options:
- Replace your current authentication with Devise, which might include renaming some database columns and customizing the Devise encryption method to match your current one
- Use the Authlogic or Devise source code as an inspiration and roll your own.
It all depends on your current authentication to be honest.
Best regards
Peter De Berdt
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment