X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=test%2Flib%2Fauthenticator.js;h=9fa220097d09b0112fc1649defb7e67efe0c3fca;hb=93fbeab317901033612318b672aff060682df8a6;hp=5da64397118439ff57cff5e414a83c8bfb3d6da7;hpb=70645846baf3aa9ecb7f6f49de143a4282128a73;p=squeep-authentication-module diff --git a/test/lib/authenticator.js b/test/lib/authenticator.js index 5da6439..9fa2200 100644 --- a/test/lib/authenticator.js +++ b/test/lib/authenticator.js @@ -305,6 +305,16 @@ describe('Authenticator', function () { const result = await authenticator.sessionCheck(req, res, ctx, loginPath, required, profilesAllowed); assert.strictEqual(result, true); }); + it('covers valid insecure cookie session', async function () { + authenticator.secureAuthOnly = false; + req.getHeader.returns(cookie); + sinon.stub(authenticator, 'isValidCookieAuth').resolves(true); + ctx.session = { + authenticatedIdentifier: 'user', + }; + const result = await authenticator.sessionCheck(req, res, ctx, loginPath, required, profilesAllowed); + assert.strictEqual(result, true); + }); it('rejects insecure connection', async function () { ctx.clientProtocol = 'http'; try {