slight oversight

This commit is contained in:
Evert Prants 2019-08-08 15:37:52 +03:00
parent a7289af257
commit 004fdcacb2
Signed by: evert
GPG Key ID: 1688DA83D222D0B5

View File

@ -235,36 +235,39 @@ router.get('/user/manage', ensureLogin, wrap(async (req, res) => {
totpEnabled = await API.User.Login.totpTokenRequired(req.session.user) totpEnabled = await API.User.Login.totpTokenRequired(req.session.user)
} }
let et = config.external
if (et) {
// Decide whether we need a disconnect or a log in with button for social account logins // Decide whether we need a disconnect or a log in with button for social account logins
if (config.twitter && config.twitter.api) { if (et.twitter && et.twitter.api) {
if (!socialStatus.enabled.twitter) { if (!socialStatus.enabled.twitter) {
res.locals.twitter_auth = true res.locals.twitter = true
} else if (socialStatus.source !== 'twitter') { } else if (socialStatus.source !== 'twitter') {
res.locals.twitter_auth = false res.locals.twitter = false
} }
} }
if (config.discord && config.discord.api) { if (et.discord && et.discord.api) {
if (!socialStatus.enabled.discord) { if (!socialStatus.enabled.discord) {
res.locals.discord_auth = true res.locals.discord = true
} else if (socialStatus.source !== 'discord') { } else if (socialStatus.source !== 'discord') {
res.locals.discord_auth = false res.locals.discord = false
} }
} }
if (config.facebook && config.facebook.client) { if (et.facebook && et.facebook.client) {
if (!socialStatus.enabled.facebook) { if (!socialStatus.enabled.facebook) {
res.locals.facebook_auth = config.facebook.client res.locals.facebook = et.facebook.client
} else if (socialStatus.source !== 'facebook') { } else if (socialStatus.source !== 'facebook') {
res.locals.facebook_auth = false res.locals.facebook = false
} }
} }
if (config.google && config.google.api) { if (et.google && et.google.api) {
if (!socialStatus.enabled.google) { if (!socialStatus.enabled.google) {
res.locals.google_auth = config.google.api res.locals.google = et.google.api
} else if (socialStatus.source !== 'google') { } else if (socialStatus.source !== 'google') {
res.locals.google_auth = false res.locals.google = false
}
} }
} }