1
0
mirror of https://github.com/spacebarchat/server.git synced 2024-11-25 03:33:33 +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 2f065e6b37
commit d151283b08

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 });
},
);