diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-06-16 21:09:35 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-06-16 21:09:35 +0300 |
commit | dbfedde341ef6434d40c4c2495f2be751f8bb973 (patch) | |
tree | b99819d19e81e2c7c269005763e8840b2c5acd1f /app/controllers | |
parent | a6533d71f53cd7f97a31100334154a82a9f37deb (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/omniauth_callbacks_controller.rb | 10 | ||||
-rw-r--r-- | app/controllers/projects/issues_controller.rb | 9 |
2 files changed, 19 insertions, 0 deletions
diff --git a/app/controllers/omniauth_callbacks_controller.rb b/app/controllers/omniauth_callbacks_controller.rb index 927b50245a4..45decccfc36 100644 --- a/app/controllers/omniauth_callbacks_controller.rb +++ b/app/controllers/omniauth_callbacks_controller.rb @@ -178,6 +178,7 @@ class OmniauthCallbacksController < Devise::OmniauthCallbacksController flash[:notice] = _('Welcome back! Your account had been deactivated due to inactivity but is now reactivated.') end + store_after_sign_up_path_for_user if intent_to_register? sign_in_and_redirect(user, event: :authentication) end else @@ -259,6 +260,11 @@ class OmniauthCallbacksController < Devise::OmniauthCallbacksController (request_params['remember_me'] == '1') if request_params.present? end + def intent_to_register? + request_params = request.env['omniauth.params'] + (request_params['intent'] == 'register') if request_params.present? + end + def store_redirect_fragment(redirect_fragment) key = stored_location_key_for(:user) location = session[key] @@ -291,6 +297,10 @@ class OmniauthCallbacksController < Devise::OmniauthCallbacksController def fail_admin_mode_invalid_credentials redirect_to new_admin_session_path, alert: _('Invalid login or password') end + + def store_after_sign_up_path_for_user + store_location_for(:user, users_sign_up_welcome_path) + end end OmniauthCallbacksController.prepend_mod_with('OmniauthCallbacksController') diff --git a/app/controllers/projects/issues_controller.rb b/app/controllers/projects/issues_controller.rb index 7101f5d772f..f974b16468c 100644 --- a/app/controllers/projects/issues_controller.rb +++ b/app/controllers/projects/issues_controller.rb @@ -20,6 +20,8 @@ class Projects::IssuesController < Projects::ApplicationController before_action :disable_query_limiting, only: [:create_merge_request, :move, :bulk_update] before_action :check_issues_available! before_action :issue, unless: ->(c) { ISSUES_EXCEPT_ACTIONS.include?(c.action_name.to_sym) } + before_action :redirect_if_task, unless: ->(c) { ISSUES_EXCEPT_ACTIONS.include?(c.action_name.to_sym) } + after_action :log_issue_show, unless: ->(c) { ISSUES_EXCEPT_ACTIONS.include?(c.action_name.to_sym) } before_action :set_issuables_index, if: ->(c) { @@ -402,6 +404,13 @@ class Projects::IssuesController < Projects::ApplicationController # Overridden in EE def create_vulnerability_issue_feedback(issue); end + + def redirect_if_task + return render_404 if issue.task? && !project.work_items_feature_flag_enabled? + return unless issue.task? + + redirect_to project_work_items_path(project, issue.id, params: request.query_parameters) + end end Projects::IssuesController.prepend_mod_with('Projects::IssuesController') |