Don't include email from Discord if we don't receive it

TODO: diagnose *why* we aren't receiving the email from Discord
This commit is contained in:
Eliot Partridge
2019-09-13 12:12:07 -05:00
parent e39ab96d34
commit be6e518a08
+1 -1
View File
@@ -121,7 +121,7 @@ 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]; 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