Closed kashgo22 closed 4 years ago
If you downloaded this from PyPI, that may be the reason. It appears those additional endpoints were added later, but the updated package has not yet been published.
I just ended up adding those endpoints manually.
That makes sense, how can I add those endpoints manually?
Thanks!
Honestly, I just copied and pasted the necessary code from this repo and added it to a views.py
file :rofl:
Worked! Thanks so much ( :
You can also get those through PyPi, you just need to specify you want the latest release candidate.
pip install django-rest-passwordreset==1.1.0rc3
I tried installing the latest release as you described for a different project, but still experienced the same issue I originally described, not sure why?
I don't know if you still have the same issues but for django-rest-passwordreset==1.1.0rc3 the urls didn't change at that point and you should call them like this: {API_URL}/ (is the default reset password request) {API_URL}/confirm/ (is the confirmation url) {API_URL}/validate_token/ (is to validate your token)
so if you defined your custom url as: path('api/password_reset/' ...
then your urls would be:
api/password_reset/ api/password_reset/confirm/ api/password_reset/validate_token/
We have just released 1.1.0 on pypi. Please check if the issue persists.
We have just released 1.1.0 on pypi. Please check if the issue persists.
yes issues still exsists, I just installed through pip and i still see same endpoints for all urls
I don't know if you still have the same issues but for django-rest-passwordreset==1.1.0rc3 the urls didn't change at that point and you should call them like this: {API_URL}/ (is the default reset password request) {API_URL}/confirm/ (is the confirmation url) {API_URL}/validate_token/ (is to validate your token)
so if you defined your custom url as: path('api/password_reset/' ...
then your urls would be:
api/password_reset/ api/password_reset/confirm/ api/password_reset/validate_token/
tried this, but still got same issue
Sorry that's was my bad i forgot to put backslash on my path. used this: /forgot should be like this: /forgot/
I have this issue on 1.10 and 1.10-rc3 from pip install. The endpoints are missing.
I had the same problem, but I think I have fixed it. It may just be inaccurate documentation. If you do not use the "password_reset" prefix, they work fine.
I have the following line in my url conf:
path('password-reset/', include('django_rest_passwordreset.urls', namespace='password_reset')),
I can then access the endpoints:
Generate token: http://127.0.0.1:8000/may-app/password-reset/
Confirm token: http://127.0.0.1:8000/my-app/password-reset/confirm
Validate token: http://127.0.0.1:8000/my-app/password-reset/validate_token
It seems that generate token actually works for any url that doesn't match any others.
Hope this helps.
+1 for @SethThoburn
If you look closer, django_rest_passwordreset.urls
does not include any reset_password
prefix:
""" URL Configuration for core auth
"""
from django.conf.urls import url, include
from django_rest_passwordreset.views import reset_password_request_token, reset_password_confirm, reset_password_validate_token
app_name = 'password_reset'
urlpatterns = [
url(r'^validate_token/', reset_password_validate_token, name="reset-password-validate"),
url(r'^confirm/', reset_password_confirm, name="reset-password-confirm"),
url(r'^', reset_password_request_token, name="reset-password-request"),
]
The documentation is quite misleading and should be updated. I can create a quick PR if there isn't an existing one.
Update: I created a PR just now #101.
Hello,
I am probably doing something silly wrong, but I've been unable to use the /reset_password/confirm/ and /reset_password/validate_token/ endpoints.
I am able to post to /reset_password/, generate the token, receive the signal and send the email.
path('api/password_reset/', include('django_rest_passwordreset.urls', namespace='password_reset')),
I have the above in my urls.py
When I go to: http://127.0.0.1:8000/api/password_reset/reset_password/ I can post an email to request a token.
When I go to: http://127.0.0.1:8000/api/password_reset/reset_password/validate_token/ or http://127.0.0.1:8000/api/password_reset/reset_password/confirm/ there is no change from http://127.0.0.1:8000/api/password_reset/reset_password/, this is what I see:
Any idea why this is the case?
Thanks!