This commit is contained in:
lesion 2024-02-28 22:37:57 +01:00
parent 6ce01287e4
commit ff6fc6fe23
No known key found for this signature in database
GPG key ID: 352918250B012177
2 changed files with 9 additions and 2 deletions

View file

@ -95,6 +95,11 @@ module.exports = {
const APEvent = req.body?.object
const ap_id = APEvent?.id ?? APEvent
if (!res.locals.fedi_user.following) {
log.warn(`[FEDI] APUser not followed`)
return res.sendStatus(404)
}
if (!ap_id) {
return res.sendStatus(404)
}

View file

@ -6,6 +6,7 @@ const log = require('../log')
const settingsController = require('../api/controller/settings')
const { DateTime } = require('luxon')
const Helpers = require('./helpers')
const get = require('lodash/get')
module.exports = {
get (req, res) {
@ -108,9 +109,10 @@ module.exports = {
async remove (req, res) {
const ap_actor = await APUser.findOne({ where: { ap_id: get(req.body, 'object.id', req.body.object) }})
const ap_id = get(req.body, 'object.id', req.body.object)
const ap_actor = await APUser.findOne({ where: { ap_id }})
if (!ap_actor) {
log.info(`[FEDI] Delete of unknown object ${get(req.body, 'object.id', req.body.object)}`)
log.info(`[FEDI] Delete of unknown object ${ap_id}`)
return res.status(404).send('Not found')
}