From af097a888536c704ac7d5c7b4963edce5edc92c1 Mon Sep 17 00:00:00 2001 From: lilleman Date: Sun, 21 Jun 2026 23:26:23 +0200 Subject: [PATCH] Verification/recovery: guard the OTP code field against a pasted space (numeric inputmode + digits-only pattern + one-time-code autofill); Kratos doesn't trim, so a space-padded code was rejected as 'invalid or already used' --- src/field.test.ts | 4 ++++ src/flow-view.test.ts | 24 ++++++++++++++++++++++++ src/flow-view.ts | 9 ++++++++- views/partials/field.ejs | 3 ++- 4 files changed, 38 insertions(+), 2 deletions(-) diff --git a/src/field.test.ts b/src/field.test.ts index 0c6b5d5..053c836 100644 --- a/src/field.test.ts +++ b/src/field.test.ts @@ -43,6 +43,10 @@ test("field defaults to a bare text input, escapes a string error, and never thr const bare = flat(await render({ id: "x", name: "x", label: "X" })); assert.match(bare, /