X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/bf29550db840c97cafffbe1e836750bef6c7942d..62b6d159672ad29344c7b7074a37d23b16dbb5d9:/app/controllers/user_controller.rb?ds=sidebyside diff --git a/app/controllers/user_controller.rb b/app/controllers/user_controller.rb index b9ed54096..7ebe6b6b6 100644 --- a/app/controllers/user_controller.rb +++ b/app/controllers/user_controller.rb @@ -117,6 +117,15 @@ 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 + return + end @title = 'login' if params[:user] email_or_display_name = params[:user][:email]