diff --git a/src/index.ts b/src/index.ts index 03e7d5e..6147d7f 100644 --- a/src/index.ts +++ b/src/index.ts @@ -144,6 +144,11 @@ export const app = new Elysia() const id = Math.random().toString().substring(2, 10) let metadata = await getMetadata() + // Check duplicate owner key + if (metadata.find((p) => p.owner_key === owner_key)) { + done(400, "Owner key already in use. Please use a unique owner key.") + } + // Process and save files // We use {id}-1 and {id}-2 as requested by "{id}-{number}" const originalExt = photo.name.split(".").pop() || "jpg"