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:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-06-16 21:09:35 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-06-16 21:09:35 +0300
commitdbfedde341ef6434d40c4c2495f2be751f8bb973 (patch)
treeb99819d19e81e2c7c269005763e8840b2c5acd1f /app/controllers/omniauth_callbacks_controller.rb
parenta6533d71f53cd7f97a31100334154a82a9f37deb (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/controllers/omniauth_callbacks_controller.rb')
-rw-r--r--app/controllers/omniauth_callbacks_controller.rb10
1 files changed, 10 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')