python-social-auth
python-social-auth copied to clipboard
Yahoo Oauth2 if no email returns guid on email place
If Yahoo does not returns email, instead of it we get guid value. It's unusual, in most others backends we get empty string in this case. Is it for some reason, or it can be changed?
file social/backends/yahoo.py:
class YahooOAuth2(BaseOAuth2):
...
def get_user_details(self, response):
...
email = emails[0]['handle'] if emails else response.get('guid', '')
There are a few options to override the default behavior:
- Add a custom pipeline after
social_detailsthat will alter the value in thedetailsparameter - Extend the Yahoo backend and override the
get_user_details()method, then replace the line inAUTHENTICATION_BACKENDSto point to your version of the backend.