pow-auth / assent

Multi-provider framework in Elixir
https://powauth.com
MIT License
391 stars 45 forks source link

Capture primary email that is not at head of list #15

Closed raygesualdo closed 4 years ago

raygesualdo commented 4 years ago

I have multiple email addresses associated with GitHub and my current "primary email" is number 4 in a list of 6. The current implementation of get_primary_email/1 assumed the primary email would be at the head of the list. This PR refactors get_primary_email/1 to now recurse through the whole list.

danschultzer commented 4 years ago

Good catch, thanks! Just added some unit tests 😄

raygesualdo commented 4 years ago

Thanks! I was going to do that tonight, but you beat me to it 😁