I just implemented reset password in my app using django.contrib.auth.views
. I'm on the half way now but there is one problem with PasswordResetConfirmView
.
When I requested for password reset by entering the email, my app sent a link to the email that i just input. After I clicked on that link, it redirected me to a view which is PasswordResetConfirmView
. After entered the new password, new confirm password, and submit the form it returns 200 success response without redirecting me to the PasswordResetCompleteView
and also the password is not changed yet.
I think i miss something but can't figure it out so I'm here asking for help.
urls.py
from django.contrib.auth import views as auth_views
urlpatterns = [
path('reset-pasword/',
auth_views.PasswordResetView.as_view(template_name="password_reset/password_reset.html"),
name="password_reset"),
path('reset-password-done/',
auth_views.PasswordResetDoneView.as_view(template_name="password_reset/password_reset_done.html"),
name="password_reset_done"),
path('reset-password-confirm/<uidb64>/<token>/',
auth_views.PasswordResetConfirmView.as_view(template_name="password_reset/password_reset_confirm.html"),
name="password_reset_confirm"),
path('reset-password-complete/',
auth_views.PasswordResetCompleteView.as_view(template_name="password_reset/password_reset_complete.html"),
name="password_reset_complete"),
]
[Updated] here is the response
"POST /user-account/reset-password-confirm/NA/ah5gne-48bf0be46e301fc88c52e0fb060b0f0b/ HTTP/1.1" 200 16764
Everything works perfectly fine except password is not changed.
Read more here: https://stackoverflow.com/questions/65920700/password-reset-confirm-return-200-success-reponse-but-password-is-not-changed-in
Content Attribution
This content was originally published by Nhib Leanghak at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.