add _CCUNKNOWN
This commit is contained in:
parent
1b8d474756
commit
ad02bc3714
4 changed files with 9 additions and 4 deletions
|
@ -2,7 +2,7 @@ const verifyAuth = require('./verifyAuth')
|
|||
|
||||
const publicMiddleware = () => global._CC.config.wishlist.public
|
||||
? (req, res, next) => {
|
||||
if (!req.user) req.user = { _id: 'Unknown' }
|
||||
if (!req.user) req.user = { _id: '_CCUNKNOWN' }
|
||||
next()
|
||||
}
|
||||
: verifyAuth()
|
||||
|
|
|
@ -9,7 +9,12 @@ module.exports = options => {
|
|||
return res.send('auth fail')
|
||||
}
|
||||
if (authed) return next()
|
||||
if (_CC.config.guestPassword && req.query.pw === _CC.config.guestPassword) return next()
|
||||
if (_CC.config.guestPassword && req.query.pw === _CC.config.guestPassword) {
|
||||
req.user = {
|
||||
_id: '_CCUNKNOWN'
|
||||
}
|
||||
return next()
|
||||
}
|
||||
res.redirect(options.failureRedirect || config.defaultFailureRedirect)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue