LISTS_PUBLIC

This commit is contained in:
Wingy 2020-11-08 17:23:51 -05:00
parent 12558d3384
commit fc9fbc6bdf
5 changed files with 37 additions and 22 deletions

View file

@ -0,0 +1,10 @@
const verifyAuth = require('./verifyAuth')
const publicMiddleware = () => process.env.LISTS_PUBLIC === 'true'
? (req, res, next) => {
if (!req.user) req.user = { _id: 'Unknown' }
next()
}
: verifyAuth()
module.exports = publicMiddleware