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

getting a 400 error saying email is a required field when hitting the confirm endpoint #146

Closed otisscott closed 3 years ago

otisscott commented 3 years ago

I followed the documentation to a T and have the token creation and the email sending, but when I attempt to hit the confirm endpoint locally using post man with the token I received in the last email, it appears that the request is being handled as if I am hitting password_reset.

path('password_reset', include('django_rest_passwordreset.urls', namespace='password_reset')), This is my entry in URLs

AdilRaoCs commented 3 years ago

I am facing the same issue.

HectorOrdonezCergentis commented 3 years ago

Also encountering this issue.

Happens on confirm and also in token. If email is passed seems like the endpoint being hit is "password_reset".

nezhar commented 3 years ago

Do you go against the /confirm/ or /validate_token endpoints? Can you maybe provide an export of the xhr request?

HectorOrdonezCergentis commented 3 years ago

Hitting this one http://localhost:8000/password_reset/confirm/ with token in params.

nezhar commented 3 years ago

Can you also provide some extra details such as routing configuration and the global DRF settings?

otisscott commented 3 years ago

I am using postman to test the endpoints both locally and on a pre-prod deployment on azure. Based on some nice print statements I setup, the receiver for base password_reset endpoint is being hit despite hitting password_reset/confirm/ with the token and fresh password in the body. What specific settings for DRF would be helpful to see? I am using the default url routing as defined in the readme

nezhar commented 3 years ago

Do you have the final / configured in the routes as in the docs? (example: '^api/password_reset/').

Otherwise you may try to hit an invalid route such as password_reset/test/ with DEBUG enabled and check the output of the configured routes.

In terms of DRF settings I was wondering if this may be related to https://github.com/anexia-it/django-rest-passwordreset/issues/67

otisscott commented 3 years ago

Fixed. I ended up needing to explicitly add each of the routes in my urls in order to get it to work