sahat / megaboilerplate

Handcrafted starter projects, optimized for simplicity and ease of use.
MIT License
3.83k stars 257 forks source link

Github JWT authentication #168

Open vcooley opened 8 years ago

vcooley commented 8 years ago

With github authentication using JWT and SQL (haven't checked the others), if a user does not have a public email, profile.email is null. This creates a problem if more than one user try to sign up without a public email as emails must be unique.

I fixed this in my code by making a request to the /user/emails endpoint. I'd be happy to share my fix in a PR, but I used promisify-node to promisify request and I'm not sure whether that's ok or not for this project.