iMerica / dj-rest-auth

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

Password Reset Confirm Uid not working #278

Open femiir opened 3 years ago

femiir commented 3 years ago

how do I really implement this I am a super noob to the world of Django and have spent a whole day trying to fix this

I get the mail link (http://localhost:8000/api/v1/users/password/reset/confirm/MjA/ap7paa-6b5972d819c153e9eff5c76408475d32/)

and when I click on the mail link, It takes me to the password reset page with four fields which are

  1. New password1
  2. New password2
  3. Uid
  4. Token

my urls.py looks like this


urlpatterns = [
    path('admin/', admin.site.urls),
    path('api/v1/', include('posts.urls')),
    path('api-auth/', include('rest_framework.urls')),
    path('api/v1/users/', include('dj_rest_auth.urls')),
    path('api/v1/users/register/', include('dj_rest_auth.registration.urls')),
    path('api/v1/users/register/verify-email/', VerifyEmailView.as_view(), name='account_email_verification_sent'),
    path('api/v1/users/register/verify-email/<str:key>/', ConfirmEmailView.as_view(), name='account_confirm_email'),
    path('api/v1/users/password/reset/confirm/<uidb64>/<token>/', PasswordResetConfirmView.as_view(), name='password_reset_confirm'),
    # path('password-reset/confirm/<uidb64>/<token>/', TemplateView.as_view(), name='password_reset_confirm')

    # path('accounts/', include('allauth.urls')),

    path('swagger/', schema_view.with_ui('swagger', cache_timeout=0), name='schema-swagger-ui'),
    path('redoc/', schema_view.with_ui('redoc', cache_timeout=0), name='schema-redoc'),
]

everything works but I keep getting

{
    "token": [
        "Invalid value"
    ]
}
Kub-AT commented 3 years ago

Check this out: https://github.com/iMerica/dj-rest-auth/pull/276#issuecomment-872042837 and this https://github.com/iMerica/dj-rest-auth/issues/269

femiir commented 3 years ago

thanks so much so I used @squio gist to solve this and another method that works is downgrading to version 2.1.5

chymdyugah commented 3 years ago

Looks like it's solved in 2.1.9 👌

femiir commented 3 years ago

Looks like it's solved in 2.1.9 👌

guess a big thumbs up to @iMerica and all contributors

Tobeyforce commented 3 years ago

On 2.1.9 UID is still invalid & 2.11 didn't work. Downgrading to 2.1.5 worked for me.

Tobeyforce commented 3 years ago

Downgrading to 2.1.5 actually broke the dj-rest-auth/registration/resend-email/ for me.. This is messy :(

Waqasii commented 2 years ago

Downgrading 2.1.5 works for me as well, Thanks guys