diff options
Diffstat (limited to 'src/api/utils')
| -rw-r--r-- | src/api/utils/Util.js | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/api/utils/Util.js b/src/api/utils/Util.js index 80bffd5..7f6dd22 100644 --- a/src/api/utils/Util.js +++ b/src/api/utils/Util.js @@ -208,10 +208,8 @@ class Util { static async isAuthorized(req) { if (req.headers.token) { - if (!this.options.canApiKey) return false; const user = await db.table('users').where({ apiKey: req.headers.token }).first(); - if (!user) return false; - if (!user.enabled) return false; + if (!user || !user.enabled) return false; return true; } |