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:
authorBob Van Landuyt <bob@vanlanduyt.co>2018-06-08 14:20:44 +0300
committerBob Van Landuyt <bob@vanlanduyt.co>2018-06-08 20:17:00 +0300
commit3d713ac114085e091815aa486fb96905347c3002 (patch)
tree64c7ee7c43e2a313bf75e10c14b09ef9c1ccd0d4 /app/controllers/users
parentebdc7f11d9c1a2a492e4af6918d407882ce5737d (diff)
Users can accept terms during registration
When a user checks the `accept` checkbox, we will track that acceptance as usual. That way they don't need to accept again after they complete the registration. When an unauthenticated user visits the `/-/users/terms` page, there is no button to accept, decline or continue. The 'current-user menu' is also hidden from the top bar.
Diffstat (limited to 'app/controllers/users')
-rw-r--r--app/controllers/users/terms_controller.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/controllers/users/terms_controller.rb b/app/controllers/users/terms_controller.rb
index f7c6d1d59db..1b1560a2a00 100644
--- a/app/controllers/users/terms_controller.rb
+++ b/app/controllers/users/terms_controller.rb
@@ -2,6 +2,7 @@ module Users
class TermsController < ApplicationController
include InternalRedirect
+ skip_before_action :authenticate_user!
skip_before_action :enforce_terms!
skip_before_action :check_password_expiration
skip_before_action :check_two_factor_requirement
@@ -14,7 +15,7 @@ module Users
def index
@redirect = redirect_path
- if @term.accepted_by_user?(current_user)
+ if current_user && @term.accepted_by_user?(current_user)
flash.now[:notice] = "You have already accepted the Terms of Service as #{current_user.to_reference}"
end
end