diff --git a/apps/api/src/__tests__/seed-uat-credentials.test.ts b/apps/api/src/__tests__/seed-uat-credentials.test.ts index 0f0691f..e04b7a9 100644 --- a/apps/api/src/__tests__/seed-uat-credentials.test.ts +++ b/apps/api/src/__tests__/seed-uat-credentials.test.ts @@ -36,7 +36,7 @@ const TEST_PASSWORD = "test-password-123"; function hashPassword(password: string): string { const salt = randomBytes(16); - const hashed = scryptSync(password, salt, 64, { N: 32768, r: 8, p: 1 }).toString("base64"); + const hashed = scryptSync(password, salt, 64, { N: 4096, r: 8, p: 1 }).toString("base64"); return `${salt.toString("base64")}:${hashed}`; } @@ -178,7 +178,7 @@ async function seedUatCredentials( // skip — already has credential account } else { const salt = randomBytes(16); - const hashed = scryptSync(password, salt, 64, { N: 32768, r: 8, p: 1 }).toString("base64"); + const hashed = scryptSync(password, salt, 64, { N: 4096, r: 8, p: 1 }).toString("base64"); const passwordHash = `${salt.toString("base64")}:${hashed}`; const newAccount: AccountRow = { @@ -277,7 +277,7 @@ describe("seedUatCredentials — credential provisioning logic", () => { // Verify the hash can be verified with the original password const salt = Buffer.from(saltB64, "base64"); const storedHash = Buffer.from(hashB64, "base64"); - const computed = scryptSync(TEST_PASSWORD, salt, 64, { N: 32768, r: 8, p: 1 }); + const computed = scryptSync(TEST_PASSWORD, salt, 64, { N: 4096, r: 8, p: 1 }); expect(computed).toEqual(storedHash); }); @@ -414,8 +414,8 @@ describe("password hash format — scrypt parameters", () => { const [salt1, key1] = hash1.split(":"); const [salt2, key2] = hash2.split(":"); - const computed1 = scryptSync("same-password", Buffer.from(salt1, "base64"), 64, { N: 32768, r: 8, p: 1 }); - const computed2 = scryptSync("same-password", Buffer.from(salt2, "base64"), 64, { N: 32768, r: 8, p: 1 }); + const computed1 = scryptSync("same-password", Buffer.from(salt1, "base64"), 64, { N: 4096, r: 8, p: 1 }); + const computed2 = scryptSync("same-password", Buffer.from(salt2, "base64"), 64, { N: 4096, r: 8, p: 1 }); expect(computed1).toEqual(Buffer.from(key1, "base64")); expect(computed2).toEqual(Buffer.from(key2, "base64")); diff --git a/apps/api/src/db/factories.ts b/apps/api/src/db/factories.ts index 9f801e2..da1f438 100644 --- a/apps/api/src/db/factories.ts +++ b/apps/api/src/db/factories.ts @@ -102,7 +102,11 @@ export function buildPet(overrides: Partial & { clientId: string }): Pet customFields: {}, photoKey: null, photoUploadedAt: null, - image: null, + coatType: null, + temperamentScore: null, + temperamentFlags: [], + medicalAlerts: [], + preferredCuts: [], createdAt: new Date("2025-01-01T00:00:00Z"), updatedAt: new Date("2025-01-01T00:00:00Z"), };