X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/8bf0a3197c53b8671f4dcf65855e38d2a2143035..814822120a6becb634a22e872094b8fa16c3ea4f:/app/controllers/user_controller.rb diff --git a/app/controllers/user_controller.rb b/app/controllers/user_controller.rb index b9ed54096..825c92635 100644 --- a/app/controllers/user_controller.rb +++ b/app/controllers/user_controller.rb @@ -117,6 +117,14 @@ class UserController < ApplicationController end def login + if session[:user] + # The user is logged in already, if the referer param exists, redirect them to that + if params[:referer] + redirect_to params[:referer] + else + redirect_to :controller => 'site', :action => 'index' + end + end @title = 'login' if params[:user] email_or_display_name = params[:user][:email]