cleaner next/prev event

This commit is contained in:
les
2020-06-03 22:52:10 +02:00
parent c953fbf319
commit d2218cffea
4 changed files with 42 additions and 40 deletions

View File

@@ -115,11 +115,12 @@ const Helpers = {
return res.data
})
.catch(e => {
debug(e)
debug(`[ERR] ${URL}: ${e}`)
return false
})
if (fedi_user) {
debug(`Create a new AP User => ${URL}`)
fedi_user = await APUser.create({ ap_id: URL, object: fedi_user })
}
return fedi_user
@@ -136,6 +137,7 @@ const Helpers = {
if (instance) { return instance }
}
// TODO: is this a standard? don't think so
instance = await axios.get(`${instance_url}/api/v1/instance`, { headers: { Accept: 'application/json' } })
.then(res => res.data)
.then(instance => {
@@ -169,7 +171,7 @@ const Helpers = {
}
// little hack -> https://github.com/joyent/node-http-signature/pull/83
req.headers.authorization = 'Signature ' + req.headers.signature
// req.headers.authorization = 'Signature ' + req.headers.signature
req.fedi_user = user