Merge pull request #120 from BytewaveMLP/hotfix-discord-login

Hotfix: Don't include email from Discord if we don't receive it
This commit is contained in:
Eliot Partridge
2019-09-13 16:45:22 -05:00
committed by GitHub
+3 -1
View File
@@ -121,7 +121,9 @@ export function getProfileUrl(profile: OAuthProfile): string | undefined {
export function getProfileEmails(profile: OAuthProfile): string[] { export function getProfileEmails(profile: OAuthProfile): string[] {
if (profile.provider === 'discord') { if (profile.provider === 'discord') {
return [profile.email as string]; // TODO: diagnose why we aren't receiving the email from Discord
// for now, we just won't attempt to record an email if we don't receive one
return profile.email ? [profile.email] : [];
} else if (profile.emails && profile.emails.length) { } else if (profile.emails && profile.emails.length) {
return profile.emails.map(e => e.value); return profile.emails.map(e => e.value);
} else if (profile._json && profile._json.attributes && profile._json.attributes.email) { // patreon } else if (profile._json && profile._json.attributes && profile._json.attributes.email) { // patreon