When a new user confirms their email address, log them automatically and
redirect them to their account page so they can set their home location and description if they want.
This commit is contained in:
parent
8dff7e86e5
commit
235999b835
1 changed files with 4 additions and 4 deletions
|
@ -137,12 +137,12 @@ class UserController < ApplicationController
|
||||||
@user = User.find_by_token(params[:confirm_string])
|
@user = User.find_by_token(params[:confirm_string])
|
||||||
if @user && @user.active == 0
|
if @user && @user.active == 0
|
||||||
@user.active = true
|
@user.active = true
|
||||||
|
@user.token = User.make_token
|
||||||
|
@user.timeout = 1.day.from_now
|
||||||
@user.save
|
@user.save
|
||||||
flash[:notice] = 'Confirmed your account, thanks for signing up!'
|
flash[:notice] = 'Confirmed your account, thanks for signing up!'
|
||||||
|
session[:token] = @user.token
|
||||||
#FIXME: login the person magically
|
redirect_to :action => 'account', :display_name => @user.display_name
|
||||||
|
|
||||||
redirect_to :action => 'login'
|
|
||||||
else
|
else
|
||||||
flash[:notice] = 'Something went wrong confirming that user.'
|
flash[:notice] = 'Something went wrong confirming that user.'
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue