mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 22:57:21 +01:00
Remove inbox from more routes (#10300)
* remove inbox from user/stats routes * remove inbox from news routes * change signature for authWithHeaders * do not load inbox in coupons routes * do not load inbox in challenge routes * do not load inbox in some members routes * do not load inbox in chat routes
This commit is contained in:
@@ -67,7 +67,9 @@ api.getCoupons = {
|
||||
api.generateCoupons = {
|
||||
method: 'POST',
|
||||
url: '/coupons/generate/:event',
|
||||
middlewares: [authWithHeaders(), ensureSudo],
|
||||
middlewares: [authWithHeaders({
|
||||
userFieldsToExclude: ['inbox'],
|
||||
}), ensureSudo],
|
||||
async handler (req, res) {
|
||||
req.checkParams('event', res.t('eventRequired')).notEmpty();
|
||||
req.checkQuery('count', res.t('countRequired')).notEmpty().isNumeric();
|
||||
@@ -92,7 +94,9 @@ api.generateCoupons = {
|
||||
api.enterCouponCode = {
|
||||
method: 'POST',
|
||||
url: '/coupons/enter/:code',
|
||||
middlewares: [authWithHeaders()],
|
||||
middlewares: [authWithHeaders({
|
||||
userFieldsToExclude: ['inbox'],
|
||||
})],
|
||||
async handler (req, res) {
|
||||
let user = res.locals.user;
|
||||
|
||||
@@ -118,7 +122,10 @@ api.enterCouponCode = {
|
||||
api.validateCoupon = {
|
||||
method: 'POST',
|
||||
url: '/coupons/validate/:code',
|
||||
middlewares: [authWithHeaders(true)],
|
||||
middlewares: [authWithHeaders({
|
||||
optional: true,
|
||||
userFieldsToExclude: ['inbox'],
|
||||
})],
|
||||
async handler (req, res) {
|
||||
req.checkParams('code', res.t('couponCodeRequired')).notEmpty();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user