slight oversight #2

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

View File

@ -237,36 +237,37 @@ router.get('/user/manage', ensureLogin, wrap(async (req, res) => {
let et = config.external
if (et) {
res.locals.auth = {}
// Decide whether we need a disconnect or a log in with button for social account logins
if (et.twitter && et.twitter.api) {
if (!socialStatus.enabled.twitter) {
res.locals.twitter = true
res.locals.auth.twitter = true
} else if (socialStatus.source !== 'twitter') {
res.locals.twitter = false
res.locals.auth.twitter = false
}
}
if (et.discord && et.discord.api) {
if (!socialStatus.enabled.discord) {
res.locals.discord = true
res.locals.auth.discord = true
} else if (socialStatus.source !== 'discord') {
res.locals.discord = false
res.locals.auth.discord = false
}
}
if (et.facebook && et.facebook.client) {
if (!socialStatus.enabled.facebook) {
res.locals.facebook = et.facebook.client
res.locals.auth.facebook = et.facebook.client
} else if (socialStatus.source !== 'facebook') {
res.locals.facebook = false
res.locals.auth.facebook = false
}
}
if (et.google && et.google.api) {
if (!socialStatus.enabled.google) {
res.locals.google = et.google.api
res.locals.auth.google = et.google.api
} else if (socialStatus.source !== 'google') {
res.locals.google = false
res.locals.auth.google = false
}
}
}