-
Notifications
You must be signed in to change notification settings - Fork 309
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Password reset throws error with django 3.1 #118
Comments
Hi @IIFelix, thanks for raising this issue. I'll investigate this evening. |
The problem here is that the resulted token length is longer than the length defined in the URL pattern. I believe that the recent changes with the hashing algorithm are responsible for this |
Can you show us all your URLS on your app @IIFelix ? In Django Rest Auth we have this URL for
This URL pattern does not accept kwargs or patterns, so this suggest you might be having an issue with a custom URL that has overridden this one. |
All our tests currently pass in Django 3.1 Tox output
|
I think he may followed the demo project, here is a past issue with an exmaple for what I did back then which is the same as the url in the issue. |
If I'm right, you should follow Michael's suggestion and use the mentioned url pattern instead of the one in the demo project. |
But thanks for raising this, now, I know that password reset token length got increased which is better. |
My urls inside the usermanagement app look like this: `from django.urls import path, include urlpatterns = [ As @mohmyo commented i just copied the passwort reset confirm url used for generating emails from the demo project. Reverse for 'password_reset_confirm' not found. 'password_reset_confirm' is not a valid view function or pattern name. In your faq (https://dj-rest-auth.readthedocs.io/en/latest/faq.html) at point 2 it's mentioned i should check the urls from the demo project, that's why i copied it. |
Sorry, I think we were confusing the path for dj-rest-auth itself and the path that is used internally by Django for a password reset template that is used to send the email. I'm using this one at my project
|
Works now with your path! tyvm |
Glad it helped |
Hi, first of all thanks @mohmyo - your solution worked. I don't understand however why this is not default behavior in As a newcomer I'd expect this to work by default in an auth package. There may be a design consideration here, I'm just trying to understand it. Would it not be good to at least add it to the docs in installation? I'd be happy to amend it if it's suitable and someone can explain the rationale. |
I think @iMerica can put more details on the table regarding design or to address this clearly. |
Thanks @mohmyo . Please consider putting this on the demo project.. The FAQ directs users to check the demo folder for fixing this issue, which does not work. |
Hello,
recently updated django to version 3.1 and the password reset view throws error:
django.urls.exceptions.NoReverseMatch: Reverse for 'password_reset_confirm' with keyword arguments '{'uidb64': 'MTA', 'token': 'a88hdr-5fb0f72acbe1e9d2b81b7810dee31037'}' not found. 1 pattern(s) tried: ['usermanagement\/password-reset/confirm/(?P[0-9A-Za-z_\-]+)/(?P[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$']
If i roll back to django 3.0 it works again.
The text was updated successfully, but these errors were encountered: