From afacc1df073bd10933fb2bae9e4918a7794d9c62 Mon Sep 17 00:00:00 2001 From: Andris Reinman Date: Wed, 31 Jul 2019 11:56:53 +0300 Subject: [PATCH] make sure that auth result is an array --- lib/user-handler.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/user-handler.js b/lib/user-handler.js index 8f6ddb0d..192073de 100644 --- a/lib/user-handler.js +++ b/lib/user-handler.js @@ -370,6 +370,9 @@ class UserHandler { this.asyncAuthenticate(username, password, requiredScope, meta) .catch(err => callback(err)) .then(result => { + if (!Array.isArray(result)) { + result = [].concat(result || [false, false]); + } callback(null, ...result); }); }