X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/bf29550db840c97cafffbe1e836750bef6c7942d..b051dd11afd42e2ae6fc8ec99982ddfc26788fe8:/app/controllers/user_controller.rb?ds=sidebyside 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]