I wanted to use djoser
for the reset password functionality and as per the documentation:
PASSWORD_RESET_CONFIRM_URL
URL to your frontend password reset page. It should contain {uid} and {token} placeholders, e.g.
#/password-reset/{uid}/{token}
. You should pass uid and token to reset password confirmation endpoint.
I have done the following:
PASSWORD_RESET_CONFIRM_URL': 'reset/password/reset/confirm/{uid}/{token}',
url
url(r'^reset/password/reset/confirm/(?P<uid>[\w-]+)/(?P<token>[\w-]+)/$', PasswordResetView.as_view(),),
View :
class PasswordResetView(APIView):
def get (self, request, uid, token):
post_data = {'uid': uid, 'token': token}
return Response(post_data)
In my mail I get this link : http://127.0.0.1:8000/reset/password/reset/confirm/Mjk/538-954dccbc1b06171eff4d
This is obvious that I will get :
{
"uid": "Mjk",
"token": "538-954dccbc1b06171eff4d"
}
as my output but I wanted to go to auth/password/reset/confirm
when the user clicks the link in the mail.
Lets describe the actions first:
You can then use following method to reset the password.