fix: fix test script for forgot password
Some checks failed
Deploy / deploy (push) Successful in 56s
Security Tests / security-non-db (push) Failing after 19s
Security Tests / security-db (push) Successful in 22s

This commit is contained in:
2026-03-01 21:52:12 -06:00
parent 15e0c0a88a
commit b6db624d92
2 changed files with 15 additions and 2 deletions

View File

@@ -122,10 +122,17 @@ describe("A04 Cryptographic Failures (runtime adversarial checks)", () => {
});
it("accepts token with correct signature, issuer, and audience", async () => {
const user = await app.prisma.user.create({
data: {
email: `jwt-runtime-${Date.now()}@test.dev`,
emailVerified: true,
},
select: { id: true },
});
const nowSeconds = Math.floor(Date.now() / 1000);
const token = signHs256Token(
{
sub: `valid-${Date.now()}`,
sub: user.id,
iss: "skymoney-api",
aud: "skymoney-web",
iat: nowSeconds,
@@ -141,5 +148,7 @@ describe("A04 Cryptographic Failures (runtime adversarial checks)", () => {
expect(res.status).toBe(200);
expect(res.body.ok).toBe(true);
await app.prisma.user.delete({ where: { id: user.id } });
});
});