log in after signup

9 views
Skip to first unread message

kevinpfromnm

unread,
Apr 2, 2012, 4:34:15 PM4/2/12
to hobo...@googlegroups.com
This seems like it should be pretty common requirement but haven't been able to find an example.  While I'm sure I could work it out, figured give it a shot in case someone had an easy way to accomplish this.  And to also make a post that's hopefully easier to find via search.

erbecke

unread,
Apr 4, 2012, 9:29:36 AM4/4/12
to Hobo Users
Hi kevinpfromnm

what I have done is automatically login and redirect to the front page
after clicking on the user activation (link on the email).
The key is the "self.current_user = this" line on the activation
lyfecycle.

I'm still using Hobo 1.0.1 in my production server.

----------
class UsersController < ApplicationController

hobo_user_controller

auto_actions :all, :except => [ :index, :new, :create ]

( ...)

def activate
do_transition_action :activate do
if valid?
self.current_user = this
flash[:notice] = "Your account was successfully activated"
redirect_to "/front"
end
end
end

(...)

end

-----------

Best regards,
eddie.

Bryan Larsen

unread,
Apr 4, 2012, 9:34:23 AM4/4/12
to hobo...@googlegroups.com
>
> what I have done is automatically login and redirect to the front page
> after clicking on the user activation (link on the email).
> The key is the "self.current_user = this" line on the activation
> lyfecycle.
>

I'm fairly sure this is sufficient. There's a "def current_user=" in
the hobo user model which puts the user into the session as well as
the current_user variable.

Bryan

kevinpfromnm

unread,
Apr 4, 2012, 11:51:14 AM4/4/12
to hobo...@googlegroups.com
Sounds good.  Thanks
Reply all
Reply to author
Forward
0 new messages