a fix for issue 6
main problem appears to be the list of supported auths `ids` was mistakenly being used when building the owner file also a fix for login button still using Persona after an alternative has been added
This commit is contained in:
@ -105,7 +105,19 @@ update_footer = (ownerName, isAuthenticated) ->
|
||||
if response.ok
|
||||
console.log 'Alternative Identity added', response
|
||||
settings.usingPersona = false
|
||||
update_footer ownerName, isAuthenticated
|
||||
if settings.wikiHost
|
||||
dialogHost = settings.wikiHost
|
||||
else
|
||||
dialogHost = window.location.hostname
|
||||
settings.cookieDomain = dialogHost
|
||||
if settings.useHttps
|
||||
dialogProtocol = 'https:'
|
||||
else
|
||||
dialogProtocol = window.location.protocol
|
||||
if window.location.port
|
||||
dialogHost = dialogHost + ':' + window.location.port
|
||||
settings.dialogURL = dialogProtocol + '//' + dialogHost + '/auth/loginDialog'
|
||||
update_footer ownerName, isAuthenticated
|
||||
else
|
||||
console.log 'Attempt to claim site failed', response
|
||||
)
|
||||
|
@ -448,7 +448,7 @@ module.exports = exports = (log, loga, argv) ->
|
||||
user = req.session.passport.user
|
||||
|
||||
idProviders = _.keys(user)
|
||||
ids = {}
|
||||
userIds = {}
|
||||
idProviders.forEach (idProvider) ->
|
||||
id = switch idProvider
|
||||
when "twitter" then {
|
||||
@ -486,7 +486,7 @@ module.exports = exports = (log, loga, argv) ->
|
||||
email: user.persona.email
|
||||
}
|
||||
}
|
||||
ids = _.merge(ids, id)
|
||||
userIds = _.merge(userIds, id)
|
||||
|
||||
wikiDir = path.resolve(argv.data, '..')
|
||||
statusDir = argv.status.split(path.sep).slice(-1)[0]
|
||||
@ -505,7 +505,7 @@ module.exports = exports = (log, loga, argv) ->
|
||||
|
||||
if _.intersectionWith(_.entries(siteOwner), _.entries(user), _.isEqual).length > 0
|
||||
updateOwner = _.merge(user, siteOwner)
|
||||
fs.writeFile(path.join(wikiDir, file), JSON.stringify(ids), (err) ->
|
||||
fs.writeFile(path.join(wikiDir, file), JSON.stringify(userIds), (err) ->
|
||||
if err
|
||||
console.log 'Error writing ', file, err
|
||||
# if the write works the change will be picked up by fs.watch() in watchForOwnerChange
|
||||
|
Reference in New Issue
Block a user