diff options
Diffstat (limited to 'app/services/users')
-rw-r--r-- | app/services/users/create_service.rb | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/app/services/users/create_service.rb b/app/services/users/create_service.rb index 2ac6dfd90fa..ec8b3cea664 100644 --- a/app/services/users/create_service.rb +++ b/app/services/users/create_service.rb @@ -11,12 +11,19 @@ module Users def execute(skip_authorization: false) user = Users::BuildService.new(current_user, params).execute(skip_authorization: skip_authorization) + reset_token = user.generate_reset_token if user.recently_sent_password_reset? - @reset_token = user.generate_reset_token if user.recently_sent_password_reset? - - notify_new_user(user, @reset_token) if user.save + after_create_hook(user, reset_token) if user.save user end + + private + + def after_create_hook(user, reset_token) + notify_new_user(user, reset_token) + end end end + +Users::CreateService.prepend_if_ee('EE::Users::CreateService') |