promote: uat → main (GRO-1509 OIDC accountLinking fix) #46
@@ -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"));
|
||||
|
||||
@@ -102,7 +102,11 @@ export function buildPet(overrides: Partial<PetRow> & { 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"),
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user