frankie567 / httpx-oauth

Async OAuth client using HTTPX
https://frankie567.github.io/httpx-oauth/
MIT License
136 stars 45 forks source link

Handle KeyError when accessing id and email in get_id_email method of clients #276

Closed BolotZhusupekov07 closed 1 year ago

BolotZhusupekov07 commented 1 year ago

There is a case if user has not specified an email in their account (Facebook in my case). In response it returns only id. Maybe use dict.get(key) instead of dict['key']

frankie567 commented 1 year ago

Thank you for the report @BolotZhusupekov07!

I've fixed it like you suggested. In the next version, the email will be Optional in the return type of get_id_email, which will help to support cases like this.