minor on federation

This commit is contained in:
lesion
2019-07-29 23:35:47 +02:00
parent 3aaad91e8b
commit 4e72576854
2 changed files with 13 additions and 12 deletions

View File

@@ -9,12 +9,12 @@ router.get('/', async (req, res) => {
if (!resource || !resource.includes('acct:')) {
return res.status(400).send('Bad request. Please make sure "acct:USER@DOMAIN" is what you are sending as the "resource" query parameter.')
}
const name = resource.replace('acct:', '')
const domain = 'localhoasf'
const name = resource.match(/acct:(.*)@/)[1]
const domain = new URL(config.baseurl).host
const user = await User.findOne({where: { username: name } })
if (!user) return res.status(404).send(`No record found for ${name}`)
const ret = {
subject: `acct:${name}:${domain}`,
subject: `acct:${name}@${host}`,
links: [
{
rel: 'self',