Thanks Vivek, I actually had already considered adding the field to check wether it was the first time they logged in. I will try what you suggested and let you know about the result. On Sep 20, 2012 6:43 PM, "Vivek Sampara" <[email protected]> wrote:
> I would consider doing this in 2 ways. > > 1. If you dont mind considering to change the user model , add a bool > field to user model "login_firsttime" and set it to true by default for > all. > add a check on the user_controller login action > if login_firsttime? > redirect_to [your_custom_form_to_force_password_change] > end > 2. on the controller > if user.created_at == user.updated_at > redirect_to [your_custom_form_to_force_password_change] > end > > Cheers, > Vivek > > > On Thu, Sep 20, 2012 at 10:50 PM, Ricardo Mejia <[email protected]> wrote: > >> Thanks Bryan, I tried changing the activate transition the way you >> mentioned, but nothing happened. What I want to do is force the user to >> change his password the first time he logs in. All the user's user and >> password are already created. >> >> >> 2012/9/20 Bryan Larsen <[email protected]> >> >>> In one of our apps we tweaked the lifecycle to add an activation step: >>> >>> transition :activate, { :inactive => :active }, :params => >>> [:password, :password_confirmation], :available_to => :key_holder >>> >>> cheers, >>> Bryan >>> >>> >>> On Thu, Sep 20, 2012 at 2:37 AM, Vivek Sampara <[email protected]> >>> wrote: >>> > /app/controllers/users_controller.rb >>> > >>> > def login >>> > hobo_login >>> > end >>> > >>> > Vivek >>> > >>> > >>> > On Thu, Sep 20, 2012 at 3:17 AM, odieom <[email protected]> wrote: >>> >> >>> >> For the life of me I cannot find where to do this. I haven't even been >>> >> able to find where the login action takes place. Can anyone help me? >>> >> >>> >> -- >>> >> You received this message because you are subscribed to the Google >>> Groups >>> >> "Hobo Users" group. >>> >> To view this discussion on the web visit >>> >> https://groups.google.com/d/msg/hobousers/-/N10xB-PU4TUJ. >>> >> To post to this group, send email to [email protected]. >>> >> To unsubscribe from this group, send email to >>> >> [email protected]. >>> >> For more options, visit this group at >>> >> http://groups.google.com/group/hobousers?hl=en. >>> > >>> > >>> > -- >>> > You received this message because you are subscribed to the Google >>> Groups >>> > "Hobo Users" group. >>> > To post to this group, send email to [email protected]. >>> > To unsubscribe from this group, send email to >>> > [email protected]. >>> > For more options, visit this group at >>> > http://groups.google.com/group/hobousers?hl=en. >>> >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "Hobo Users" group. >>> To post to this group, send email to [email protected]. >>> To unsubscribe from this group, send email to >>> [email protected]. >>> For more options, visit this group at >>> http://groups.google.com/group/hobousers?hl=en. >>> >>> >> -- >> You received this message because you are subscribed to the Google Groups >> "Hobo Users" group. >> To post to this group, send email to [email protected]. >> To unsubscribe from this group, send email to >> [email protected]. >> For more options, visit this group at >> http://groups.google.com/group/hobousers?hl=en. >> > > -- > You received this message because you are subscribed to the Google Groups > "Hobo Users" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/hobousers?hl=en. > -- You received this message because you are subscribed to the Google Groups "Hobo Users" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/hobousers?hl=en.
