social-app-django
social-app-django copied to clipboard
Reset password mail is not sent for user authenticated with OAuth
Expected behaviour
I want users authenticated with OAuth to be able to reset their password through standard Django resetting password method, through mail.
Actual behaviour
Despite user being registered with Google, for example, he doesn't get a reset password mail to the gmail of his account he used to sign up with OAuth.
What are the steps to reproduce this issue?
- Sign up with Google
- Log out.
- Try to get reset password mail on yourwebste.com/accounts/password_reset/
Any logs, error output, etc?
No
Problem is here https://github.com/django/django/blob/4.0.5/django/contrib/auth/forms.py#L303 because users created via social auth will not have has_usable_password
. So maybe setting some random very strong password to the user while sign up could bypass this problem?
So maybe setting some random very strong password to the user while sign up could bypass this problem?
FTR that's exactly what we do in one of our apps: https://github.com/kiwitcms/enterprise/blob/master/tcms_enterprise/pipeline.py#L29