fix: token verify

isekai-main
Barış Soner Uşaklı 3 years ago
parent 1783f918bc
commit 04dab1d550

@ -44,13 +44,9 @@ Auth.getLoginStrategies = function () {
}; };
Auth.verifyToken = async function (token, done) { Auth.verifyToken = async function (token, done) {
let { tokens = [] } = await meta.settings.get('core.api'); const { tokens = [] } = await meta.settings.get('core.api');
tokens = tokens.reduce((memo, cur) => { const tokenObj = tokens.find(t => t.token === token);
memo[cur.token] = cur.uid; const uid = tokenObj ? tokenObj.uid : undefined;
return memo;
}, {});
const uid = tokens[token];
if (uid !== undefined) { if (uid !== undefined) {
if (parseInt(uid, 10) > 0) { if (parseInt(uid, 10) > 0) {

Loading…
Cancel
Save