1
0
mirror of https://github.com/spacebarchat/server.git synced 2024-11-10 04:32:35 +01:00

Add back include_url param to reg tokens

This commit is contained in:
Madeline 2023-01-10 18:08:31 +11:00
parent 6755f1392d
commit 30ec479e25
No known key found for this signature in database
GPG Key ID: 1958E017C36F2E47

View File

@ -33,9 +33,17 @@ router.get(
transaction: false,
});
if (req.query.plain)
return res.send(tokens.map((x) => x.token).join("\n"));
const ret = req.query.include_url
? tokens.map(
(x) =>
`${Config.get().general.frontPage}/register?token=${
x.token
}`,
)
: tokens.map((x) => x.token);
return res.json({ tokens: tokens.map((x) => x.token) });
if (req.query.plain) return res.send(ret.join("\n"));
return res.json({ tokens: ret });
},
);