diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-06-20 14:10:13 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-06-20 14:10:13 +0300 |
commit | 0ea3fcec397b69815975647f5e2aa5fe944a8486 (patch) | |
tree | 7979381b89d26011bcf9bdc989a40fcc2f1ed4ff /app/controllers/omniauth_callbacks_controller.rb | |
parent | 72123183a20411a36d607d70b12d57c484394c8e (diff) |
Add latest changes from gitlab-org/gitlab@15-1-stable-eev15.1.0-rc42
Diffstat (limited to 'app/controllers/omniauth_callbacks_controller.rb')
-rw-r--r-- | app/controllers/omniauth_callbacks_controller.rb | 10 |
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') |