From 8f3d1796eb431dc7302ff91219ccbea8f92be19a Mon Sep 17 00:00:00 2001 From: Angus McLeod Date: Wed, 16 Sep 2020 23:35:07 +1000 Subject: [PATCH] Ensure after_signup runs for oauth singups --- extensions/users_controller.rb | 9 +++++++++ plugin.rb | 2 ++ 2 files changed, 11 insertions(+) create mode 100644 extensions/users_controller.rb diff --git a/extensions/users_controller.rb b/extensions/users_controller.rb new file mode 100644 index 00000000..71e62293 --- /dev/null +++ b/extensions/users_controller.rb @@ -0,0 +1,9 @@ +module CustomWizardUsersController + def account_created + if current_user.present? && + (wizard = CustomWizard::Wizard.after_signup(current_user)) + return redirect_to "/w/#{wizard.id.dasherize}" + end + super + end +end \ No newline at end of file diff --git a/plugin.rb b/plugin.rb index dc3aa75b..127be7ec 100644 --- a/plugin.rb +++ b/plugin.rb @@ -74,6 +74,7 @@ after_initialize do ../serializers/custom_wizard/log_serializer.rb ../extensions/extra_locales_controller.rb ../extensions/invites_controller.rb + ../extensions/users_controller.rb ../extensions/wizard_field.rb ../extensions/wizard_step.rb ].each do |path| @@ -153,6 +154,7 @@ after_initialize do ::ExtraLocalesController.prepend ExtraLocalesControllerCustomWizard ::InvitesController.prepend InvitesControllerCustomWizard + ::UsersController.prepend CustomWizardUsersController ::Wizard::Field.prepend CustomWizardFieldExtension ::Wizard::Step.prepend CustomWizardStepExtension