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 | 30ec479e2591769a490c23a772ba26997d57c23c (patch) | |
tree | 14124542d773c214c29931390197ef9f3f6267c1 /src | |
parent | Move sentry init to util. use sentry in each module, not just bundle (diff) | |
download | server-30ec479e2591769a490c23a772ba26997d57c23c.tar.xz |
Add back include_url param to reg tokens
Diffstat (limited to 'src')
-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 }); }, ); |