directoryserver: 2fa validation tests
This commit is contained in:
@@ -436,6 +436,12 @@ describe('User', function () {
|
||||
expect(error.reason).to.equal(BoxError.INVALID_CREDENTIALS);
|
||||
expect(error.message).to.be('Invalid totpToken');
|
||||
});
|
||||
|
||||
it('verify succeeds with valid 2fa', async function () {
|
||||
const totpToken = speakeasy.totp({ secret: twofa.secret, encoding: 'base32' });
|
||||
const user = await users.verifyWithUsername(admin.username, admin.password, users.AP_WEBADMIN, { totpToken });
|
||||
expect(user.id).to.be(admin.id);
|
||||
});
|
||||
});
|
||||
|
||||
describe('active', function () {
|
||||
|
||||
Reference in New Issue
Block a user