This repository has been archived by the owner on Jul 15, 2020. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixing bug triggered by Facebook not returning an email address
Fixes #22. * Have refactored how oAuth services that don't return email addresses work, which is cleaner in the code and and makes it easier to add providers that don't return them. * The sign-in page now shows "N/A" if we don't have a valid email address for the user (i.e. if the value is a placeholder email address ending in @localhost.localdomain). * Have added in the defensive checks to fix the bug which triggered the crash. * Also added hooks to log uncaughtException and unhandledRejection errors to make it easy to debug issues like this in production with now-logs. I don't know why the Facebook API is no longer returning an email address, even though we already explicitly ask for that field. I don't know if this something specific to privacy settings on my account, or a result in the change on the API. Either way, Facebook oAuth works again, we just aren't able to grab the email address the user has given to Facebook (and we now just handle that gracefully). It's worth noting the reason we bother with a temporary email address at all is because it makes it easier to also support email based sign-in at the same time as supporting oAuth (if we only did oAuth then we wouldn't have to care about an email address field).
- Loading branch information