Fix insecure default id for invites (#1789)

* Fix insecure default id for invites

* Use 16 bytes
This commit is contained in:
ekzyis 2025-01-03 16:42:28 +01:00 committed by GitHub
parent 077727dced
commit 47debbcb06
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 1 deletions

View File

@ -0,0 +1,2 @@
-- AlterTable
ALTER TABLE "Invite" ALTER COLUMN "id" SET DEFAULT encode(gen_random_bytes(16), 'hex'::text);

View File

@ -467,7 +467,7 @@ model LnWith {
}
model Invite {
id String @id @default(cuid())
id String @id @default(dbgenerated("encode(gen_random_bytes(16), 'hex'::text)"))
createdAt DateTime @default(now()) @map("created_at")
updatedAt DateTime @default(now()) @updatedAt @map("updated_at")
userId Int