Skip to content

Commit 561cfc5

Browse files
authored
fix(connect): validate platform param in disconnect route + prior cleanup (#234)
1 parent a66cd6c commit 561cfc5

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

apps/backend/src/routes/connect.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,11 @@ export async function connectRoutes(app: FastifyInstance) {
142142
const userId = (request.user as any).id;
143143
const { platform } = request.params;
144144

145+
const SUPPORTED_PLATFORMS = ['github', 'google', 'twitter', 'linkedin'];
146+
if (!SUPPORTED_PLATFORMS.includes(platform)) {
147+
return reply.status(400).send({ error: `Unsupported platform: ${platform}` });
148+
}
149+
145150
try {
146151
await app.prisma.oAuthToken.delete({
147152
where: {

0 commit comments

Comments
 (0)