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' }; }