mirror of
https://github.com/Terncode/pixel.horse.git
synced 2026-09-24 21:55:52 +02:00
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:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user