Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorJason Hollingsworth <jhworth.developer@gmail.com>2013-12-03 18:22:33 +0400
committerJason Hollingsworth <jhworth.developer@gmail.com>2013-12-04 23:10:20 +0400
commitc099074fcc96304d948cc028ff7ae5913b561ed3 (patch)
treefcfb93fbd75f00c62b527d1829014bbf8b90c476 /app
parent23d180f5f1905eb8d714daaf2d097767ff355817 (diff)
Fix 404 on project page for unauthenticated user
Eliminate a 404 error when user is not logged in and attempts to visit a project page. The 404 page will still show up when user is logged in and the project doesn’t exist or the user doesn’t have access.
Diffstat (limited to 'app')
-rw-r--r--app/controllers/application_controller.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index a83d6dfed8d..e5b5a3a4777 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -81,6 +81,9 @@ class ApplicationController < ActionController::Base
if @project and can?(current_user, :read_project, @project)
@project
+ elsif current_user.nil?
+ @project = nil
+ authenticate_user!
else
@project = nil
render_404 and return