]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/user_controller.rb
When a new user confirms their email address, log them automatically and
[rails.git] / app / controllers / user_controller.rb
index cc934fc325ec04ad5c5642ef583e8cd2a03d2d03..631da97d0ef29907d93a257da5a8591677b276db 100644 (file)
@@ -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