Remove dead signup router, unused verification functions, and legacy cleanup query
All checks were successful
Build & Deploy to Staging / Build & Deploy to Staging (push) Successful in 18m37s

- Delete src/routes/signup.ts (dead code, 410 handler in index.ts remains)
- Remove isEmailVerified() and getVerifiedApiKey() from verification.ts (only used by signup)
- Remove stale-key cleanup from cleanupStaleData() that queried legacy verifications table
- Update usage middleware message: 'Free tier limit' → 'Account limit'
- TDD: 8 new tests, removed signup.test.ts (dead), net 556 tests passing
This commit is contained in:
Hoid 2026-03-08 14:07:50 +01:00
parent 921562750f
commit 7206cb518d
11 changed files with 79 additions and 308 deletions

View file

@ -0,0 +1,44 @@
import { describe, it, expect } from "vitest";
import { readFileSync, existsSync } from "fs";
import { join } from "path";
describe("Dead Signup Router Removal", () => {
describe("Signup router module removed", () => {
it("should not have src/routes/signup.ts file", () => {
const signupPath = join(__dirname, "../routes/signup.ts");
expect(existsSync(signupPath)).toBe(false);
});
});
describe("Dead verification functions removed from source", () => {
it("should not export isEmailVerified from verification.ts source", () => {
const src = readFileSync(join(__dirname, "../services/verification.ts"), "utf8");
expect(src).not.toContain("export async function isEmailVerified");
});
it("should not export getVerifiedApiKey from verification.ts source", () => {
const src = readFileSync(join(__dirname, "../services/verification.ts"), "utf8");
expect(src).not.toContain("export async function getVerifiedApiKey");
});
it("should still export createPendingVerification", () => {
const src = readFileSync(join(__dirname, "../services/verification.ts"), "utf8");
expect(src).toContain("export async function createPendingVerification");
});
it("should still export verifyCode", () => {
const src = readFileSync(join(__dirname, "../services/verification.ts"), "utf8");
expect(src).toContain("export async function verifyCode");
});
});
describe("410 signup handler still works", () => {
it("should still have signup 410 handler working", async () => {
const request = (await import("supertest")).default;
const { app } = await import("../index.js");
const res = await request(app).post("/v1/signup/free");
expect(res.status).toBe(410);
expect(res.body.error).toContain("discontinued");
});
});
});