2FA-Login: Prüfung schlägt nicht offen fehl, Fehlversuche vor dem Aufruf zählen
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
acc86c267b
commit
d7c2027d3f
6 files changed
+48
-5
No files matched your search
@@ -79,3 +79,11 @@ test('Code erneut senden: neue Mail, nur der neue Code gilt', async () => {
|
||||
assert.equal((await verifyStaffMfa(key, newOtp)).ok, true)
|
||||
assert.equal(await resendStaffMfa(key), false)
|
||||
})
|
||||
|
||||
test('Parallele Fehlversuche: hoechstens 5 Versuche zaehlen', async () => {
|
||||
const { key } = await start()
|
||||
const results = await Promise.all(Array.from({ length: 10 }, () => verifyStaffMfa(key, '000000')))
|
||||
assert.equal(results.filter((r) => r.reason === 'invalid').length, 5)
|
||||
assert.equal(results.filter((r) => r.reason === 'gone').length, 5)
|
||||
assert.deepEqual(await verifyStaffMfa(key, aw.lastOtp('u_staff')), { ok: false, reason: 'gone' })
|
||||
})
|
||||
Reference in new issue
Block a user