externalldap: add tests
This commit is contained in:
@@ -427,14 +427,13 @@ describe('User', function () {
|
||||
});
|
||||
|
||||
it('verify succeeds with relaxed 2fa', async function () {
|
||||
const user = await users.verifyWithUsername(admin.username, admin.password, users.AP_WEBADMIN, { relaxedTotpCheck: true });
|
||||
const user = await users.verifyWithUsername(admin.username, admin.password, users.AP_WEBADMIN, { skipTotpCheck: true });
|
||||
expect(user.id).to.be(admin.id);
|
||||
});
|
||||
|
||||
it('verify fails with relaxed 2fa but incorrect totp', async function () {
|
||||
const [error] = await safe(users.verifyWithUsername(admin.username, admin.password, users.AP_WEBADMIN, { totpToken: 'schlecht', relaxedTotpCheck: true }));
|
||||
expect(error.reason).to.equal(BoxError.INVALID_CREDENTIALS);
|
||||
expect(error.message).to.be('Invalid totpToken');
|
||||
it('verify succeeds with relaxed 2fa but incorrect totp (totp is ignored)', async function () {
|
||||
const user = await users.verifyWithUsername(admin.username, admin.password, users.AP_WEBADMIN, { totpToken: 'schlecht', skipTotpCheck: true });
|
||||
expect(user.id).to.be(admin.id);
|
||||
});
|
||||
|
||||
it('verify succeeds with valid 2fa', async function () {
|
||||
|
||||
Reference in New Issue
Block a user