From cc489708eece595eb9501502e2e45f0ac6b01977 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Sat, 13 Mar 2021 21:25:27 -0500 Subject: [PATCH] fix: #9378, crash on verifyToken if API Token settings not saved (null case error) --- src/routes/authentication.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/routes/authentication.js b/src/routes/authentication.js index 1bd03f2f75..5ff5716478 100644 --- a/src/routes/authentication.js +++ b/src/routes/authentication.js @@ -51,7 +51,7 @@ Auth.getLoginStrategies = function () { }; Auth.verifyToken = async function (token, done) { - let { tokens } = await meta.settings.get('core.api'); + let { tokens = [] } = await meta.settings.get('core.api'); tokens = tokens.reduce((memo, cur) => { memo[cur.token] = cur.uid; return memo;