christmas/middlewares/publicRoute.js

11 lines
260 B
JavaScript
Raw Normal View History

2020-11-08 14:23:51 -08:00
const verifyAuth = require('./verifyAuth')
2020-12-01 19:09:25 -08:00
const publicMiddleware = () => global._CC.config.wishlist.public
2020-11-08 14:23:51 -08:00
? (req, res, next) => {
2022-10-03 07:49:36 -07:00
if (!req.user) req.user = { _id: '_CCUNKNOWN' }
2020-11-08 14:23:51 -08:00
next()
}
: verifyAuth()
module.exports = publicMiddleware