frankie567 / httpx-oauth

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

Github provider is hard coded to use the first email instead of the primary if no public one exists. #317

Closed lloesche closed 5 months ago

lloesche commented 5 months ago

Currently in https://github.com/frankie567/httpx-oauth/blob/master/httpx_oauth/clients/github.py#L72 when no public email address is defined it is hard coded to use the first email address instead of the user's primary email address.

The response includes a boolean 'primary': True

[{'email': 'xxxxxxxxx@gmail.com', 'primary': True, 'verified': True, 'visibility': 'public'}, {'email': 'xxxxxxxx@xxxxxx.io', 'primary': False, 'verified': True, 'visibility': None}, {'email': 'xxxxxxxxx@users.noreply.github.com', 'primary': False, 'verified': True, 'visibility': None}, {'email': 'xxxxxxxx@xxxxxxxx', 'primary': False, 'verified': True, 'visibility': None}]