summary refs log tree commit diff
path: root/src/api/routes
diff options
context:
space:
mode:
authorMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2022-12-24 16:28:00 +1100
committerMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2022-12-24 16:28:00 +1100
commit35938556fe1ed6cbbde636c9d88beeeb85105e9d (patch)
tree8021e869d7e86c05b3c9de5aea38bd118dd13fe8 /src/api/routes
parentMerge branch 'maddy/refactor' of github.com:fosscord/fosscord-server into mad... (diff)
downloadserver-35938556fe1ed6cbbde636c9d88beeeb85105e9d.tar.xz
Fix creating bot accounts
Diffstat (limited to 'src/api/routes')
-rw-r--r--src/api/routes/applications/#id/bot/index.ts5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/api/routes/applications/#id/bot/index.ts b/src/api/routes/applications/#id/bot/index.ts
index ed5d6a70..c21e19ca 100644
--- a/src/api/routes/applications/#id/bot/index.ts
+++ b/src/api/routes/applications/#id/bot/index.ts
@@ -15,6 +15,7 @@ router.post("/", route({}), async (req: Request, res: Response) => {
 	const user = await User.register({
 		username: app.name,
 		password: undefined,
+		id: app.id,
 		req,
 	});
 
@@ -29,7 +30,9 @@ router.post("/", route({}), async (req: Request, res: Response) => {
 
 	await app.save();
 
-	res.send().status(204);
+	res.send({
+		token: await generateToken(user.id)
+	}).status(204);
 });
 
 router.post("/reset", route({}), async (req: Request, res: Response) => {