adonisjs / ally

AdonisJS Social Authentication Provider
MIT License
159 stars 53 forks source link

Authentication with Github, email scope required #119

Closed M4gie closed 3 years ago

M4gie commented 3 years ago

Why this feature is required (specific use-cases will be appreciated)?

When we use the Github provider to get user's information, the scope user:email needs do be provided. If we only want publics info (without the email) ally.use('github').user() will throw.

Have you tried any other work arounds?

I check other drivers and I guess you made this one like that to stay consistent between each drivers types. We could add a boolean to get the email or we could notice users into the documentation to add the user:email scope if they want to use ally.use('github').user().

Are you willing to work on it with little guidance?

YES! I open this issue to get some tips and discuss before diving into a PR

thetutlage commented 3 years ago

Hello 👋

Sorry for the delay. I have fixed the behavior to ignore the error if the email endpoint returns 404 ( the case where access token doesn't have rights to read the user email )

Will also document the behavior.

Thanks for reporting :)