import { test } from "node:test"; import assert from "node:assert/strict"; import { legacyRecoveryToken } from "../shared/legacy-recovery"; test("legacy recovery email path yields only its code segment", () => { assert.equal(legacyRecoveryToken("/code=abc12345-6789"), "abc12345-6789"); for (const path of [ "/code=short", "/code=abc12345/other", "/code=abc%2F12345", "/auth/callback", ]) assert.equal(legacyRecoveryToken(path), null); });