anexia-it / django-rest-passwordreset

An extension of django rest framework, providing a configurable password reset strategy
BSD 3-Clause "New" or "Revised" License
419 stars 148 forks source link

[FEATURE] Send token instance in pre_password_reset and post_password_reset signals #154

Closed mikicz closed 1 year ago

mikicz commented 2 years ago

Is your feature request related to a problem? Please describe.

I'd like to log resetting passwords and was able to achieve log requesting tokens using reset_password_token_created signal, however I am unable to log specific tokens being used to reset password without overriding ResetPasswordConfirm because the signals pre_password_reset and post_password_reset are only sending the user instance, not the token instance. I can catch a reset being successful, but can't tell which token was used if there are multiple available.

Describe the solution you'd like

Add the reset_password_token instance to the signal calls for pre_password_reset and post_password_reset.

Describe alternatives you've considered

Currently solved the issue by overriding the class and adding the signal myself in my code - however this is not ideal because I have to check on each upgrade of the library that the class hasn't changed.