X-Git-Url: http://git.squeep.com/?p=squeep-authentication-module;a=blobdiff_plain;f=lib%2Fauthenticator.js;h=4449a94b700889f5c2196b77c91872ed0b52d26d;hp=0c0c349b7288af20f0fc7df421c91aeddd61a3dc;hb=70645846baf3aa9ecb7f6f49de143a4282128a73;hpb=df9be924442837d9ba2bf6d80bf2563aee264103 diff --git a/lib/authenticator.js b/lib/authenticator.js index 0c0c349..4449a94 100644 --- a/lib/authenticator.js +++ b/lib/authenticator.js @@ -66,10 +66,14 @@ class Authenticator { */ async isValidIdentifierCredential(identifier, credential, ctx) { const _scope = _fileScope('isValidIdentifierCredential'); - this.logger.debug(_scope, 'called', { identifier, credential: '*'.repeat(credential.length), ctx }); + this.logger.debug(_scope, 'called', { identifier, credential: '*'.repeat((credential || '').length), ctx }); let isValid = false; + if (typeof credential === 'undefined') { + return isValid; + } + await this.db.context(async (dbCtx) => { const authData = await this.db.authenticationGet(dbCtx, identifier); if (!authData) {