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
diff options
context:
space:
mode:
authorCagdas Gerede <Earth@BlueSky>2016-11-10 04:08:45 +0300
committerCagdas Gerede <Earth@BlueSky>2016-11-10 04:08:45 +0300
commit4acedecc7b7ba2fe0ba76464019aeaca2984655d (patch)
treef9efcb5256456a8ad8f1ab88b173009473088a86 /app/controllers/projects/forks_controller.rb
parentbcba8b25975d87d31299ac6238c1bad6da323b61 (diff)
Fixing the issue of visiting a project fork url giving 500 error when not signed in instead of being redirected to the sign in page. The main reason is ApplicationController skips authentication if the project exists. To fix the issue, forced the authentication in ForksController when current_user is nil.
Diffstat (limited to 'app/controllers/projects/forks_controller.rb')
-rw-r--r--app/controllers/projects/forks_controller.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/app/controllers/projects/forks_controller.rb b/app/controllers/projects/forks_controller.rb
index ade01c706a7..358478f90cb 100644
--- a/app/controllers/projects/forks_controller.rb
+++ b/app/controllers/projects/forks_controller.rb
@@ -29,8 +29,12 @@ class Projects::ForksController < Projects::ApplicationController
end
def new
- @namespaces = current_user.manageable_namespaces
- @namespaces.delete(@project.namespace)
+ if current_user.nil?
+ authenticate_user!
+ else
+ @namespaces = current_user.manageable_namespaces
+ @namespaces.delete(@project.namespace)
+ end
end
def create