refactoring logs: use winston

This commit is contained in:
les
2021-03-05 14:17:10 +01:00
parent 589a8ce939
commit 65cb94dd6a
22 changed files with 1977 additions and 1229 deletions

View File

@@ -1,4 +1,4 @@
const debug = require('debug')('auth')
const log = require('../log')
const oauth = require('./oauth')
const get = require('lodash/get')
@@ -40,14 +40,13 @@ const Auth = {
// TODO
hasPerm (scope) {
return (req, res, next) => {
debug(scope, req.path)
log.debug(scope, req.path)
oauth.oauthServer.authenticate({ scope })(req, res, () => {
debug('has perm')
log.debug('has perm')
next()
})
}
}
}
module.exports = Auth