[IMP] add notification for reseting password
Sébastien BEAU
committed Aug 06, 2017
commit 5c7cfe54cb145a5a91ce9b41c41073220a7dfcaa
Showing 2
changed files with
3 additions
and 2 deletions
locomotive/steam/middlewares/auth.rb b/lib/locomotive/steam/middlewares/auth.rb
+1
-1
| @@ | @@ -76,7 +76,7 @@ module Locomotive::Steam |
| def reset_password(options) | |
| return if authenticated? | |
| - | status, entry = services.auth.reset_password(options) |
| + | status, entry = services.auth.reset_password(options, request) |
| if status == :password_reset | |
| store_authenticated(entry) | |
locomotive/steam/services/auth_service.rb b/lib/locomotive/steam/services/auth_service.rb
+2
-1
| @@ | @@ -71,7 +71,7 @@ module Locomotive |
| end | |
| end | |
| - | def reset_password(options) |
| + | def reset_password(options, request) |
| return :invalid_token if options.reset_token.blank? | |
| return :password_too_short if options.password.to_s.size < MIN_PASSWORD_LENGTH | |
| @@ | @@ -87,6 +87,7 @@ module Locomotive |
| '_auth_reset_token' => nil, | |
| '_auth_reset_sent_at' => nil | |
| }) | |
| + | notify(:reset_password, entry, request) |
| return [:"#{options.password_field}_reset", entry] | |
| end | |