Skip to content

Commit

Permalink
add diagnostic route to aid debugging login issues (#26)
Browse files Browse the repository at this point in the history
* add diagnostic route to aid debugging login issues
* don't require the user to be the wiki owner
  • Loading branch information
paul90 committed Feb 14, 2020
1 parent ab7d21a commit bc402ac
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions server/social.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -629,6 +629,15 @@ module.exports = exports = (log, loga, argv) ->
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) ->
console.log 'Logout...'
Expand Down

0 comments on commit bc402ac

Please sign in to comment.