From be6e518a0875f606a1b0253de286a2e2d6ab614d Mon Sep 17 00:00:00 2001 From: Eliot Partridge Date: Fri, 13 Sep 2019 12:10:26 -0500 Subject: [PATCH] Don't include email from Discord if we don't receive it TODO: diagnose *why* we aren't receiving the email from Discord --- src/ts/server/oauth.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ts/server/oauth.ts b/src/ts/server/oauth.ts index e2a4c80..ce957ee 100644 --- a/src/ts/server/oauth.ts +++ b/src/ts/server/oauth.ts @@ -121,7 +121,7 @@ export function getProfileUrl(profile: OAuthProfile): string | undefined { export function getProfileEmails(profile: OAuthProfile): string[] { if (profile.provider === 'discord') { - return [profile.email as string]; + return profile.email ? [profile.email] : []; } else if (profile.emails && profile.emails.length) { return profile.emails.map(e => e.value); } else if (profile._json && profile._json.attributes && profile._json.attributes.email) { // patreon