diff options
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') |