Skip to content

Node.js based forum software built for the modern web

fix: #9378, crash on verifyToken if API Token settings not saved (null case error)

Julian Lamcc489708eece
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;