summaryrefslogtreecommitdiff
path: root/app/controllers/registrations_controller.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-10-07 15:05:59 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2019-10-07 15:05:59 +0000
commit31040b5bfe48f8d73830f473513164427522b3a6 (patch)
tree6301b395ad45d7a0f84aa0f9c31373889208d09b /app/controllers/registrations_controller.rb
parent185f428fa5e6123ffa0f29e307523da138e7b028 (diff)
downloadgitlab-ce-31040b5bfe48f8d73830f473513164427522b3a6.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/controllers/registrations_controller.rb')
-rw-r--r--app/controllers/registrations_controller.rb18
1 files changed, 17 insertions, 1 deletions
diff --git a/app/controllers/registrations_controller.rb b/app/controllers/registrations_controller.rb
index 2e4c6a801b0..3a2975e92d6 100644
--- a/app/controllers/registrations_controller.rb
+++ b/app/controllers/registrations_controller.rb
@@ -6,13 +6,19 @@ class RegistrationsController < Devise::RegistrationsController
include RecaptchaExperimentHelper
include InvisibleCaptcha
+ layout :choose_layout
+
prepend_before_action :check_captcha, only: :create
before_action :whitelist_query_limiting, only: [:destroy]
before_action :ensure_terms_accepted,
if: -> { action_name == 'create' && Gitlab::CurrentSettings.current_application_settings.enforce_terms? }
def new
- redirect_to(new_user_session_path)
+ if helpers.use_experimental_separate_sign_up_flow?
+ @resource = build_resource
+ else
+ redirect_to new_user_session_path(anchor: 'register-pane')
+ end
end
def create
@@ -144,6 +150,16 @@ class RegistrationsController < Devise::RegistrationsController
def stored_location_or_dashboard(user)
stored_location_for(user) || dashboard_projects_path
end
+
+ # Part of an experiment to build a new sign up flow. Will be resolved
+ # with https://gitlab.com/gitlab-org/growth/engineering/issues/64
+ def choose_layout
+ if helpers.use_experimental_separate_sign_up_flow?
+ 'devise_experimental_separate_sign_up_flow'
+ else
+ 'devise'
+ end
+ end
end
RegistrationsController.prepend_if_ee('EE::RegistrationsController')