From 862512d83a07dc579b6b949c4603fb05d769e108 Mon Sep 17 00:00:00 2001 From: officer Date: Wed, 19 Aug 2026 10:14:52 +0000 Subject: [PATCH] trim before stripping tea's comment marker tea indents its output, so stripping the leading # before trimming left it there and the page read 'Authenticated as # pastilhas (admin)'. --- sidecar/tea-config.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sidecar/tea-config.ts b/sidecar/tea-config.ts index 3b17bbe..2f5771b 100644 --- a/sidecar/tea-config.ts +++ b/sidecar/tea-config.ts @@ -176,7 +176,9 @@ export async function testTeaLogin(userId: number): Promise<{ ok: boolean; user? // around it changes. const line = out .split('\n') - .map((l) => l.replace(/^#\s*/, '').trim()) + // Trim FIRST: tea indents the line, so stripping the `#` before trimming left it in place and the + // page read "Authenticated as # pastilhas (admin)". + .map((l) => l.trim().replace(/^#\s*/, '')) .find(Boolean); return line ? { ok: true, user: line } : { ok: false, error: 'tea answered, but named no account' }; }