diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-05 12:08:43 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-05 12:08:43 +0300 |
commit | 26384c9a61da9922b8fa4b8351d4e42d51661b37 (patch) | |
tree | ef3decbed644db3c97dcdbb5b71d4ade77f3155d /app/controllers/registrations_controller.rb | |
parent | 79cbe31b18159ea394c6f6e3027c1dc69bdabb75 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/controllers/registrations_controller.rb')
-rw-r--r-- | app/controllers/registrations_controller.rb | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/app/controllers/registrations_controller.rb b/app/controllers/registrations_controller.rb index b40264bfdf4..29b0c6b29ae 100644 --- a/app/controllers/registrations_controller.rb +++ b/app/controllers/registrations_controller.rb @@ -53,7 +53,7 @@ class RegistrationsController < Devise::RegistrationsController def welcome return redirect_to new_user_registration_path unless current_user - return redirect_to stored_location_or_dashboard_or_almost_there_path(current_user) if current_user.role.present? && !current_user.setup_for_company.nil? + return redirect_to stored_location_or_dashboard(current_user) if current_user.role.present? && !current_user.setup_for_company.nil? current_user.name = nil if current_user.name == current_user.username end @@ -65,7 +65,7 @@ class RegistrationsController < Devise::RegistrationsController if result[:status] == :success track_experiment_event(:signup_flow, 'end') # We want this event to be tracked when the user is _in_ the experimental group set_flash_message! :notice, :signed_up - redirect_to stored_location_or_dashboard_or_almost_there_path(current_user) + redirect_to stored_location_or_dashboard(current_user) else render :welcome end @@ -112,12 +112,12 @@ class RegistrationsController < Devise::RegistrationsController return users_sign_up_welcome_path if experiment_enabled?(:signup_flow) - stored_location_or_dashboard_or_almost_there_path(user) + stored_location_or_dashboard(user) end def after_inactive_sign_up_path_for(resource) Gitlab::AppLogger.info(user_created_message) - Feature.enabled?(:soft_email_confirmation) ? dashboard_projects_path : users_almost_there_path + dashboard_projects_path end private @@ -179,18 +179,10 @@ class RegistrationsController < Devise::RegistrationsController Gitlab::Utils.to_boolean(params[:terms_opt_in]) end - def confirmed_or_unconfirmed_access_allowed(user) - user.confirmed? || Feature.enabled?(:soft_email_confirmation) || experiment_enabled?(:signup_flow) - end - def stored_location_or_dashboard(user) stored_location_for(user) || dashboard_projects_path end - def stored_location_or_dashboard_or_almost_there_path(user) - confirmed_or_unconfirmed_access_allowed(user) ? stored_location_or_dashboard(user) : users_almost_there_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 |