Old partial attempt at "public mode"
This commit is contained in:
parent
f872785e64
commit
8f6b030ca8
6 changed files with 37 additions and 18 deletions
11
middlewares/public.js
Normal file
11
middlewares/public.js
Normal file
|
@ -0,0 +1,11 @@
|
|||
const verifyAuth = require('./verifyAuth')
|
||||
|
||||
const middlewareNoop = ( (_1, _2, next) => next() )
|
||||
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