diff options
author | Madeline <46743919+MaddyUnderStars@users.noreply.github.com> | 2023-01-10 18:08:31 +1100 |
---|---|---|
committer | Madeline <46743919+MaddyUnderStars@users.noreply.github.com> | 2023-01-10 18:08:31 +1100 |
commit | d151283b08ed20cf6b34072b52e68bc80de9f1f9 (patch) | |
tree | 9b675ed5fd845eb7e9b3f69fd84d4963adc03033 | |
parent | Move sentry init to util. use sentry in each module, not just bundle (diff) | |
download | server-d151283b08ed20cf6b34072b52e68bc80de9f1f9.tar.xz |
Add back include_url param to reg tokens
-rw-r--r-- | src/api/routes/auth/generate-registration-tokens.ts | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/api/routes/auth/generate-registration-tokens.ts b/src/api/routes/auth/generate-registration-tokens.ts index 0d4cf067..ba40bd9a 100644 --- a/src/api/routes/auth/generate-registration-tokens.ts +++ b/src/api/routes/auth/generate-registration-tokens.ts @@ -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 }); }, ); |