diff options
| author | Pitu <[email protected]> | 2020-07-18 02:57:24 +0900 |
|---|---|---|
| committer | Pitu <[email protected]> | 2020-07-18 02:57:24 +0900 |
| commit | 5f58431409e1a4e875cd8121cfe9dc47cfecc65e (patch) | |
| tree | db311c19439699946f254154a5bd5929df047bf5 /src/api/utils/Util.js | |
| parent | fix authorization (diff) | |
| download | host.fuwn.me-5f58431409e1a4e875cd8121cfe9dc47cfecc65e.tar.xz host.fuwn.me-5f58431409e1a4e875cd8121cfe9dc47cfecc65e.zip | |
Fix authorization
Diffstat (limited to 'src/api/utils/Util.js')
| -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; } |