-
Notifications
You must be signed in to change notification settings - Fork 149
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
How to send a reset token without the user using the endpoint #141
Comments
Any help here pleaseeee? |
Have you tried to create a custom token generator? |
Can you also describe your use case a bit? After looking a second time it sound more like you need another trigger for the reset, other then the rest endpoint. |
Yes my usecase is when a user signs up (without the need of a password) I would like to send them a welcome email containing the reset password link. How can I go about doing that by leveraging the current implementation of the package and without creating my own token generator? |
At the moment the library supports the creation of the token only with the endpoint. The custom token generator won't help here. A refactoring of |
Yes Sure I can do that. Thanks for the help I was wondering if this was an out-of-the-box functionality but it appears not |
It seems that there is already a similar PR available #97 |
In #143 you can find a draft for the implementation. |
In case someone else runs into this issue, you can simply do something like this: from django_rest_passwordreset.models import ResetPasswordToken
from django.contrib.auth.models import User
my_user = User.objects.get(pk=1)
token = ResetPasswordToken.objects.create(user=my_user)
# do whatever you want with token.key here |
Since #181 has been merged, this issue will be closed. |
Currently I have this implementation:
Then when a user requests a password reset I send an email using the Signal provided by the package:
However, in my case, I want to programmatically create the token and send it to the user without the use of the endpoint meaning the user won't reset their password through the endpoint, rather my application will create the token and send it to the user.
The text was updated successfully, but these errors were encountered: