mirror of
https://github.com/hansjone/oclaw.git
synced 2026-10-13 05:50:45 +08:00
fix(uds-auth): keep login error codes on QR login, name the scanned empNo (0.3.17)
0.3.16 mapped every post-scan failure to login_finalize_failed, hiding codes with their own message (bootstrap_required, account_disabled, registration_closed). Pass those through again and only fall back for unknown errors. The bootstrap_required message now includes the scanned employee number and how to proceed (UDS_AUTH_INITIAL_ADMIN or emergency account login). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
08a5520791
commit
e61f9c6336
4 changed files with 21 additions and 6 deletions
|
|
@ -48,4 +48,13 @@ describe('upstream error messages', () => {
|
|||
assert.equal(client.split(`"err.${code}":`).length - 1, 2, code)
|
||||
}
|
||||
})
|
||||
|
||||
it('bootstrap_required names the scanned employee number and the way out', () => {
|
||||
for (const locale of ['zh', 'en']) {
|
||||
const m = apiError('bootstrap_required', locale, { empNo: '10012345' })
|
||||
assert.equal(m.error, 'bootstrap_required')
|
||||
assert.match(m.message, /UDS_AUTH_INITIAL_ADMIN=10012345/)
|
||||
assert.doesNotMatch(m.message, /\{empNo\}/)
|
||||
}
|
||||
})
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue