Skip to content

Commit 2acf1a1

Browse files
committed
test(client): open the ① probe on login, the way the card's own probe opens
The card's end-to-end probe is `login -> enable -> verifyTotp -> disable -> deleteUser`. The suite opened on the registration that had to precede that login, which is the same credential state by construction but not the same line. Spell the first step as the card spells it: a real second sign-in whose echoed token the SDK stores, asserted against the stored credential before the sequence continues. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015QE8qk46e5CHJxyQEUjbf8
1 parent 8c37777 commit 2acf1a1

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

packages/client/src/auth-rotated-session-token.test.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,16 @@ describe("#16534 ① the card's own probe, with the manual re-set deleted", () =
282282
it('login → enable → verifyTotp → disable → deleteUser, no hand-repaired credential', async () => {
283283
const { engine, manager, client, email } = await signedIn();
284284
const userId = await userIdFor(engine, email);
285+
286+
// ── the probe's FIRST step, spelled the way the card spells it. The card's
287+
// sequence opens on `login`, not on the registration that had to precede
288+
// it, so this opens on `login` too — a real second sign-in whose token
289+
// the SDK stores, which is the line the card measured verbatim:
290+
// `client.auth.login({ email, password }) -> RESOLVED { token, user }`.
291+
const session = await client.auth.login({ email, password: PASSWORD });
292+
expect(session?.data?.token, 'login echoed no token').toBeTruthy();
285293
const afterLogin = String(storedToken(client));
294+
expect(afterLogin, 'login did not store the token it was handed').toBe(session.data?.token);
286295

287296
// The premise. Without it a green run could not tell "the rotation is
288297
// followed now" from "the bearer seam never worked here".

0 commit comments

Comments
 (0)