summary refs log tree commit diff
path: root/src/api
diff options
context:
space:
mode:
authorMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2023-01-10 18:08:31 +1100
committerMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2023-01-10 18:08:31 +1100
commitd151283b08ed20cf6b34072b52e68bc80de9f1f9 (patch)
tree9b675ed5fd845eb7e9b3f69fd84d4963adc03033 /src/api
parentMove sentry init to util. use sentry in each module, not just bundle (diff)
downloadserver-d151283b08ed20cf6b34072b52e68bc80de9f1f9.tar.xz
Add back include_url param to reg tokens
Diffstat (limited to 'src/api')
-rw-r--r--src/api/routes/auth/generate-registration-tokens.ts14
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 });
 	},
 );