From 35938556fe1ed6cbbde636c9d88beeeb85105e9d Mon Sep 17 00:00:00 2001 From: Madeline <46743919+MaddyUnderStars@users.noreply.github.com> Date: Sat, 24 Dec 2022 16:28:00 +1100 Subject: Fix creating bot accounts --- src/api/routes/applications/#id/bot/index.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/api/routes/applications/#id') 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) => { -- cgit 1.4.1