Hello! I''m working on my first Rails app and I have a question regarding authentication. I already have authentication for signing up, logging in, logging out, etc. What I need is an account email activation function and a reset password (forgot password) function. I have read a little bit about Devise and watched the Railscast episodes on it, it seems 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 it easier to do it manually? Any tips or recourses and links on how to do it with Devise or manually would be appreciated! Thanks // Anders -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Peter De Berdt
2010-Oct-31 21:48 UTC
Re: Newbie - Rails 3 authentication question (Devise)
On 31 Oct 2010, at 22:24, Anders_P wrote:> I''m working on my first Rails app and I have a question regarding > authentication. I already have authentication for signing up, logging > in, logging out, etc. What I need is an account email activation > function and a reset password (forgot password) function. I have read > a little bit about Devise and watched the Railscast episodes on it, it > seems 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 it > easier 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 verifies whether 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 devise settings and then add several fields to the existing database tables: confirmation_token, confirmed_at, confirmation_sent_at and reset_password_token All of this is just a matter of quickly reading through the Devise source code and the docs on github. It''s there in plain sight. Best regards Peter De Berdt -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 31 October 2010 21:48, Peter De Berdt <peter.de.berdt-LPO8gxj9N8aZIoH1IeqzKA@public.gmane.org> wrote:> > On 31 Oct 2010, at 22:24, Anders_P wrote: > > I''m working on my first Rails app and I have a question regarding > authentication. I already have authentication for signing up, logging > in, logging out, etc. What I need is an account email activation > function and a reset password (forgot password) function. I have read > a little bit about Devise and watched the Railscast episodes on it, it > seems 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 it > easier 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 verifies > whether 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 devise > settings and then add several fields to the existing database tables: > confirmation_token, confirmed_at, confirmation_sent_at > and > reset_password_token > All of this is just a matter of quickly reading through the Devise source > code 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. Colin -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Peter De Berdt
2010-Oct-31 22:09 UTC
Re: Newbie - Rails 3 authentication question (Devise)
On 31 Oct 2010, at 22:52, Colin Law wrote:>> I''m working on my first Rails app and I have a question regarding >> authentication. I already have authentication for signing up, logging >> in, logging out, etc. What I need is an account email activation >> function and a reset password (forgot password) function. I have read >> a little bit about Devise and watched the Railscast episodes on it, >> it >> seems 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 it >> easier 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 >> verifies >> whether 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 devise >> settings and then add several fields to the existing database tables: >> confirmation_token, confirmed_at, confirmation_sent_at >> and >> reset_password_token >> All of this is just a matter of quickly reading through the Devise >> source >> code 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 -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Hi! Thanks for your help. I took the Devise route, it was a bit of hassle but it works now. Thanks // Anders On 31 Okt, 23:09, Peter De Berdt <peter.de.be...-LPO8gxj9N8aZIoH1IeqzKA@public.gmane.org> wrote:> On 31 Oct 2010, at 22:52, Colin Law wrote: > > > > > > >> I''m working on my first Rails app and I have a question regarding > >> authentication. I already have authentication for signing up, logging > >> in, logging out, etc. What I need is an account email activation > >> function and a reset password (forgot password) function. I have read > >> a little bit about Devise and watched the Railscast episodes on it, > >> it > >> seems 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 it > >> easier 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 > >> verifies > >> whether 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 devise > >> settings and then add several fields to the existing database tables: > >> confirmation_token, confirmed_at, confirmation_sent_at > >> and > >> reset_password_token > >> All of this is just a matter of quickly reading through the Devise > >> source > >> code 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-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.