summaryrefslogtreecommitdiff
path: root/app/controllers/users_controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/users_controller.rb')
-rw-r--r--app/controllers/users_controller.rb17
1 files changed, 15 insertions, 2 deletions
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index 8710eebf210..f6cef7e133c 100644
--- a/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -148,7 +148,11 @@ class UsersController < ApplicationController
end
def exists
- render json: { exists: !!Namespace.find_by_path_or_name(params[:username]) }
+ if Gitlab::CurrentSettings.signup_enabled? || current_user
+ render json: { exists: !!Namespace.find_by_path_or_name(params[:username]) }
+ else
+ render json: { error: _('You must be authenticated to access this path.') }, status: :unauthorized
+ end
end
def follow
@@ -182,7 +186,7 @@ class UsersController < ApplicationController
end
def starred_projects
- StarredProjectsFinder.new(user, current_user: current_user).execute
+ StarredProjectsFinder.new(user, params: finder_params, current_user: current_user).execute
end
def contributions_calendar
@@ -248,6 +252,15 @@ class UsersController < ApplicationController
end
end
end
+
+ def finder_params
+ {
+ # don't display projects pending deletion
+ without_deleted: true,
+ # don't display projects marked for deletion
+ not_aimed_for_deletion: true
+ }
+ end
end
UsersController.prepend_mod_with('UsersController')