add diagnostic route to aid debugging login issues (#26)

* add diagnostic route to aid debugging login issues
* don't require the user to be the wiki owner
This commit is contained in:
Paul Rodwell
2020-02-14 19:54:22 +00:00
committed by GitHub
parent ab7d21af42
commit bc402acf55

View File

@ -629,6 +629,15 @@ module.exports = exports = (log, loga, argv) ->
ownerName: id.name ownerName: id.name
}) })
app.get '/auth/diag', (req, res) ->
# some diagnostic feedback to the user, for when something strange happens
user = 'User is unknown'
try
user = req.session.passport.user
date = new Date().toString()
wikiName = new URL(argv.url).hostname
console.log 'SOCIAL *** ', date, ' *** ', wikiName, ' *** ', JSON.stringify(user)
res.json date
app.get '/logout', (req, res) -> app.get '/logout', (req, res) ->
console.log 'Logout...' console.log 'Logout...'