iMerica / dj-rest-auth

Authentication for Django Rest Framework
https://dj-rest-auth.readthedocs.io/en/latest/index.html
MIT License
1.68k stars 315 forks source link

Password rest not working #384

Closed deekshi-hari closed 2 years ago

deekshi-hari commented 2 years ago

Hi, I'm a rookie in djnago, I tried to implement password rest using this lib. I'm getting a custom link in my mail but the uid and token that i got is not working. When i send those uid and token it says invalid uid.

URLS.py ``urlpatterns = [ path('password-reset/confirm///',TemplateView.as_view(), name='password_reset_confirm'),

path('login/', CustomLoginView.as_view()),

path('logout/', LogoutView.as_view()),

path('register/', RegisterView.as_view()),

path('verify-email/', VerifyEmailView.as_view(), name='rest_verify_email'),

path('account-confirm-email/', VerifyEmailView.as_view(), name='account_email_verification_sent'),

path('account-confirm-email/<str:key>/', ConfirmEmailView.as_view()),

re_path(r'^account-confirm-email/(?P<key>[-:\w]+)/$',VerifyEmailView.as_view(), name='account_confirm_email'),

path('user-profile/', UserProfileView.as_view()),

path('google/connect/', GoogleLogin.as_view(), name='google_connect'),

path('dj-rest-auth/google/connect/', GoogleLogin.as_view(), name='github_connect'),   

path('review/',ReviewAddAPI.as_view(),name='user_review_add'),

path('review/list/',ReviewListAPI.as_view(),name='get_all_reviews'),

path('password-reset/', PasswordResetView.as_view(),name='rest_password_reset'),

path('password-reset-confirm/', PasswordResetConfirmView.as_view(), name='rest_password_reset_confirm'),

]``

when i post the UID and TOKEN to password-reset-confirm url it says invalid uid. I tried everything after reading the comments still not working. Can someone help me. I'm literally stuck in here.

deekshi-hari commented 2 years ago

I got the solution :)

mateoKutnjak commented 2 years ago

What is the solution?

kurotom commented 2 years ago

What is the solution?

https://github.com/iarsham/RestApi-Blog/blob/main/code/Config/urls.py#L32#L36

Thanks to iarsham for the solution.