python-social-auth / social-app-django

Python Social Auth - Application - Django
BSD 3-Clause "New" or "Revised" License
1.97k stars 372 forks source link

AttributeError: 'NoneType' object has no attribute 'provider' #571

Closed i-zhivetiev closed 1 month ago

i-zhivetiev commented 1 month ago

Expected behaviour

Users with a GitHub account should be able to log in.

Actual behaviour

Users with a GitHub account cannot log in; instead, they receive an error.

What are the steps to reproduce this issue?

  1. Sign up with your GitHub account.
  2. Log out.
  3. Log in using your GitHub account.

Any other comments?

Affected Version: 5.4.1

This happens because we are trying to compare str and int in the AbstractUserSocialAuth.get_social_auth method. See https://github.com/python-social-auth/social-app-django/blob/master/social_django/models.py#L63

nijel commented 1 month ago

Upgrade social- auth-core, it should be addressed already there

i-zhivetiev commented 1 month ago

Thanks, it helps, but version 5.4.1 introduces a breaking change because social-auth-core>=4.4.1 no longer works.