Fix bot token reset

This commit is contained in:
Rory&
2026-07-20 12:20:53 +02:00
parent 7d895bce16
commit 9b4d42f73f
2 changed files with 4 additions and 2 deletions
@@ -67,8 +67,9 @@ router.post(
},
}),
async (req: Request, res: Response) => {
const app = await Application.findOneOrFail({ where: { id: req.params.application_id as string } });
const bot = await User.findOneOrFail({ where: { id: req.params.application_id as string } });
const owner = req.user;
const owner = await User.findOneOrFail({ where: { id: app.owner_id }, select: { id: true, totp_secret: true } });
if (owner.id != req.user_id) throw DiscordApiErrors.ACTION_NOT_AUTHORIZED_ON_APPLICATION;
+2 -1
View File
@@ -22,7 +22,8 @@ import { MessageOptions, sendMessage } from "../handlers/Message";
import { Message } from "@spacebar/database";
export async function generatePollResultsMessage(options: MessageOptions): Promise<MessageOptions> {
const message = await Message.create({
// TODO: shouldnt this get saved?
const message = Message.create({
...options,
message_reference: options.message_reference ?? undefined,
poll: options.poll,