subhendukundu / worker-auth-providers

worker-auth-providers is an open-source providers to make authentication easy with workers. Very lightweight script which doesn't need a lot of dependencies. Plug it with any framework or template of workers.
https://authc1.com
293 stars 31 forks source link

Without user:email in the scope will cause an error of github provider #35

Closed hellodword closed 1 year ago

hellodword commented 1 year ago

https://github.com/subhendukundu/worker-auth-providers/blob/605febeb431fb86a96213bfc4f2f4bd8ec278987/src/providers/github/users.ts#L53-L63

Without user:email in the scope:

const githubLoginUrl = await github.redirect({
    options: {
        scope: ['read:user'],

And when I'm a github user without public emails, I will get an error:

TypeError: o.find is not a function

I hope email could be optional.

subhendukundu commented 1 year ago

Yup, makes sense! Would you like to create a PR?