Commit 6fb6de12 authored by Nicolas Dular's avatar Nicolas Dular

Cleanup welcome controller

parent b66fb18c
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
module Registrations module Registrations
class WelcomeController < ApplicationController class WelcomeController < ApplicationController
layout 'welcome' layout 'welcome'
skip_before_action :authenticate_user!, :required_signup_info, :check_two_factor_requirement skip_before_action :authenticate_user!, :required_signup_info, :check_two_factor_requirement, only: [:show, :update]
before_action :require_current_user before_action :require_current_user
feature_category :authentication_and_authorization feature_category :authentication_and_authorization
...@@ -16,10 +16,7 @@ module Registrations ...@@ -16,10 +16,7 @@ module Registrations
result = ::Users::SignupService.new(current_user, update_params).execute result = ::Users::SignupService.new(current_user, update_params).execute
if result[:status] == :success if result[:status] == :success
if ::Gitlab.com? && show_onboarding_issues_experiment? process_gitlab_com_tracking
track_experiment_event(:onboarding_issues, 'signed_up')
record_experiment_user(:onboarding_issues)
end
return redirect_to new_users_sign_up_group_path if experiment_enabled?(:onboarding_issues) && show_onboarding_issues_experiment? return redirect_to new_users_sign_up_group_path if experiment_enabled?(:onboarding_issues) && show_onboarding_issues_experiment?
...@@ -39,6 +36,14 @@ module Registrations ...@@ -39,6 +36,14 @@ module Registrations
current_user.role.present? && !current_user.setup_for_company.nil? current_user.role.present? && !current_user.setup_for_company.nil?
end end
def process_gitlab_com_tracking
return false unless ::Gitlab.com?
return false unless show_onboarding_issues_experiment?
track_experiment_event(:onboarding_issues, 'signed_up')
record_experiment_user(:onboarding_issues)
end
def update_params def update_params
params.require(:user).permit(:role, :setup_for_company) params.require(:user).permit(:role, :setup_for_company)
end end
...@@ -52,11 +57,9 @@ module Registrations ...@@ -52,11 +57,9 @@ module Registrations
end end
def path_for_signed_in_user(user) def path_for_signed_in_user(user)
if requires_confirmation?(user) return users_almost_there_path if requires_confirmation?(user)
users_almost_there_path
else stored_location_for(user) || dashboard_projects_path
stored_location_for(user) || dashboard_projects_path
end
end end
def show_onboarding_issues_experiment? def show_onboarding_issues_experiment?
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment