From 235999b835b1b1aa5c715997bbfbf3f702cf3de1 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Thu, 14 Jun 2007 23:55:26 +0000 Subject: [PATCH] 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. --- app/controllers/user_controller.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/controllers/user_controller.rb b/app/controllers/user_controller.rb index cc934fc32..631da97d0 100644 --- a/app/controllers/user_controller.rb +++ b/app/controllers/user_controller.rb @@ -137,12 +137,12 @@ class UserController < ApplicationController @user = User.find_by_token(params[:confirm_string]) if @user && @user.active == 0 @user.active = true + @user.token = User.make_token + @user.timeout = 1.day.from_now @user.save flash[:notice] = 'Confirmed your account, thanks for signing up!' - - #FIXME: login the person magically - - redirect_to :action => 'login' + session[:token] = @user.token + redirect_to :action => 'account', :display_name => @user.display_name else flash[:notice] = 'Something went wrong confirming that user.' end -- 2.43.2