Remove dead token-based verification system
All checks were successful
Build & Deploy to Staging / Build & Deploy to Staging (push) Successful in 12m26s

- Remove verificationsCache array and loadVerifications() function from verification.ts
- Remove verifyToken() and verifyTokenSync() functions (multi-replica unsafe, never used)
- Remove createVerification() function (stores unused data)
- Remove GET /verify route and verifyPage() helper function
- Remove loadVerifications() call from startup
- Remove createVerification() usage from signup route
- Update imports and test mocks to match removed functions
- Keep active 6-digit code system intact (createPendingVerification, verifyCode, etc.)

All 559 tests passing. The active verification system using pending_verifications
table and 6-digit codes continues to work normally.
This commit is contained in:
Hoid 2026-03-08 08:07:20 +01:00
parent d376d586fe
commit 2793207b39
6 changed files with 108 additions and 146 deletions

View file

@ -72,12 +72,9 @@ vi.mock("../services/browser.js", () => ({
// Mock verification service
vi.mock("../services/verification.js", () => ({
verifyToken: vi.fn().mockReturnValue({ status: "invalid" }),
loadVerifications: vi.fn().mockResolvedValue(undefined),
createPendingVerification: vi.fn().mockResolvedValue({ email: "test@test.com", code: "123456" }),
verifyCode: vi.fn().mockResolvedValue({ status: "ok" }),
isEmailVerified: vi.fn().mockResolvedValue(false),
createVerification: vi.fn().mockResolvedValue({ email: "test@test.com", token: "tok", apiKey: "key", createdAt: "", verifiedAt: null }),
getVerifiedApiKey: vi.fn().mockResolvedValue(null),
}));