Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

fix(web): reject upload URL reuse when video owner differs

Richie McIlroybc21c71be286
diff --git a/apps/web/actions/video/upload.ts b/apps/web/actions/video/upload.ts
index d749399f9..a61e035e0 100644
--- a/apps/web/actions/video/upload.ts
+++ b/apps/web/actions/video/upload.ts
@@ -141,6 +141,8 @@ export async function createVideoAndGetUploadUrl({
.where(eq(videos.id, videoId));
if (existingVideo) {
+ if (existingVideo.ownerId !== user.id) throw new Error("Forbidden");
+
const existingVideoDomain = Video.Video.decodeSync({
...existingVideo,
bucketId: existingVideo.bucket,