christmas/middlewares/publicRoute.js
2020-12-01 22:09:25 -05:00

10 lines
257 B
JavaScript

const verifyAuth = require('./verifyAuth')
const publicMiddleware = () => global._CC.config.wishlist.public
? (req, res, next) => {
if (!req.user) req.user = { _id: 'Unknown' }
next()
}
: verifyAuth()
module.exports = publicMiddleware