Added GitHub and Slack authentication integrations

This commit is contained in:
NGPixel
2017-02-24 16:50:04 -05:00
parent ee16b82f17
commit 9976842e45
13 changed files with 60 additions and 13 deletions

View File

@@ -50,10 +50,14 @@ userSchema.statics.processProfile = (profile) => {
primaryEmail = (e) ? e.value : _.first(profile.emails).value
} else if (_.isString(profile.email) && profile.email.length > 5) {
primaryEmail = profile.email
} else if (profile.user && profile.user.email && profile.user.email.length > 5) {
primaryEmail = profile.user.email
} else {
return Promise.reject(new Error('Invalid User Email'))
}
profile.provider = _.lowerCase(profile.provider)
return db.User.findOneAndUpdate({
email: primaryEmail,
provider: profile.provider