social-app-django icon indicating copy to clipboard operation
social-app-django copied to clipboard

Reset password mail is not sent for user authenticated with OAuth

Open Bohooslav opened this issue 2 years ago • 2 comments

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?

  1. Sign up with Google
  2. Log out.
  3. Try to get reset password mail on yourwebste.com/accounts/password_reset/

Any logs, error output, etc?

No

Bohooslav avatar Mar 31 '22 19:03 Bohooslav

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?

petrprikryl avatar Jun 28 '22 12:06 petrprikryl

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

atodorov avatar Jun 28 '22 14:06 atodorov