preparing multisite settings, fix #141
This commit is contained in:
@@ -8,10 +8,11 @@ module.exports = {
|
||||
// follow request from fediverse
|
||||
async follow (req, res) {
|
||||
const body = req.body
|
||||
const settings = res.locals.settings
|
||||
if (typeof body.object !== 'string') { return }
|
||||
const username = body.object.replace(`${config.baseurl}/federation/u/`, '')
|
||||
if (username !== settingsController.settings.instance_name) {
|
||||
log.warn(`Following the wrong user: ${username} instead of ${settingsController.settings.instance_name} (could be a wrong config.baseurl)`)
|
||||
if (username !== settings.instance_name) {
|
||||
log.warn(`Following the wrong user: ${username} instead of ${settings.instance_name} (could be a wrong config.baseurl)`)
|
||||
return res.status(404).send('User not found')
|
||||
}
|
||||
|
||||
@@ -35,10 +36,11 @@ module.exports = {
|
||||
|
||||
// unfollow request from fediverse
|
||||
async unfollow (req, res) {
|
||||
const settings = res.locals.settings
|
||||
const body = req.body
|
||||
const username = body.object.object.replace(`${config.baseurl}/federation/u/`, '')
|
||||
if (username !== settingsController.settings.instance_name) {
|
||||
log.warn(`Unfollowing wrong user: ${username} instead of ${settingsController.settings.instance_name}`)
|
||||
if (username !== settings.instance_name) {
|
||||
log.warn(`Unfollowing wrong user: ${username} instead of ${settings.instance_name}`)
|
||||
return res.status(404).send('User not found')
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user