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

Implemented the possibility to return the username and email address when validating a token #184

Closed mikelandzelo173 closed 8 months ago

mikelandzelo173 commented 11 months ago

There's a new setting for this which is set to False by default. If you set DJANGO_REST_PASSWORDRESET_USER_DETAILS_ON_VALIDATION to True then a validation call for a token will return the username and email address for the corresponding user:

{
    "status": "OK",
    "username": "superuser",
    "email": "superuser@email.com"
}

This is often needed for password reset pages where you have to show for which account you are resetting the password.

codecov-commenter commented 11 months ago

Codecov Report

All modified lines are covered by tests :white_check_mark:

Comparison is base (c225102) 90.40% compared to head (33c91a1) 90.57%.

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #184 +/- ## ========================================== + Coverage 90.40% 90.57% +0.17% ========================================== Files 12 12 Lines 271 276 +5 ========================================== + Hits 245 250 +5 Misses 26 26 ``` | [Files](https://app.codecov.io/gh/anexia-it/django-rest-passwordreset/pull/184?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=anexia-it) | Coverage Δ | | |---|---|---| | [django\_rest\_passwordreset/views.py](https://app.codecov.io/gh/anexia-it/django-rest-passwordreset/pull/184?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=anexia-it#diff-ZGphbmdvX3Jlc3RfcGFzc3dvcmRyZXNldC92aWV3cy5weQ==) | `94.94% <100.00%> (+0.26%)` | :arrow_up: |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.