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
parentbcba8b25975d87d31299ac6238c1bad6da323b61 (diff)
downloadgitlab-ce-4acedecc7b7ba2fe0ba76464019aeaca2984655d.tar.gz
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.
-rw-r--r--app/controllers/projects/forks_controller.rb8
-rw-r--r--changelogs/unreleased/fix-singin-redirect-for-fork-new.yml5
2 files changed, 11 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
diff --git a/changelogs/unreleased/fix-singin-redirect-for-fork-new.yml b/changelogs/unreleased/fix-singin-redirect-for-fork-new.yml
new file mode 100644
index 00000000000..e4cf8de8699
--- /dev/null
+++ b/changelogs/unreleased/fix-singin-redirect-for-fork-new.yml
@@ -0,0 +1,5 @@
+---
+title: Fixing the issue of the project fork url giving 500 when not signed instead
+ of being redirected to sign in page
+merge_request:
+author: Cagdas Gerede