Spend login, invite, and email-change links only after a confirm POST so mail scanners cannot use them up.

GET still shows a one-button page, a used invitation can resend or reopen for the signed-in invitee, and an email-change GET no longer signs the account out.
This commit is contained in:
adilallo committed 2026-11-22 16:58:30 -07:00
1 parent 600056499c
commit a725cf1a32
33 files changed
+1002 -89

No files matched your search

@@ -192,8 +192,9 @@ describe("POST /api/rules/[id]/stakeholders/[stakeholderId]/resend", () => {
findFirstStakeholderMock.mockResolvedValueOnce({
id: "st-1",
email: "inv@example.com",
inviteTokenHash: null,
inviteTokenHash: "kept-after-accept",
inviteExpiresAt: null,
acceptedAt: new Date("2026-01-03T00:00:00Z"),
rule: { userId: owner.id, title: "My rule" },
});
const res = await POST_RESEND(
@@ -214,6 +215,7 @@ describe("POST /api/rules/[id]/stakeholders/[stakeholderId]/resend", () => {
email: "inv@example.com",
inviteTokenHash: "old-hash",
inviteExpiresAt: new Date("2026-01-01T00:00:00Z"),
acceptedAt: null,
rule: { userId: owner.id, title: "My rule" },
});
const res = await POST_RESEND(