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)'.
This commit is contained in:
@@ -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' };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user