LISTS_PUBLIC
This commit is contained in:
parent
12558d3384
commit
fc9fbc6bdf
5 changed files with 37 additions and 22 deletions
10
middlewares/publicRoute.js
Normal file
10
middlewares/publicRoute.js
Normal 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
|
Loading…
Add table
Add a link
Reference in a new issue