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) {
let { tokens = [] } = await meta.settings.get('core.api');
tokens = tokens.reduce((memo, cur) => {
memo[cur.token] = cur.uid;
return memo;
}, {});
const uid = tokens[token];
const { tokens = [] } = await meta.settings.get('core.api');
const tokenObj = tokens.find(t => t.token === token);
const uid = tokenObj ? tokenObj.uid : undefined;
if (uid !== undefined) {
if (parseInt(uid, 10) > 0) {

Loading…
Cancel
Save