BLAH stupid middleware error

This commit is contained in:
newtbot
2024-01-25 05:11:28 +08:00
parent 057fbe2afb
commit ba498a4d4b
5 changed files with 21 additions and 23 deletions

View File

@ -186,13 +186,14 @@ app.auth = (function (app) {
function isLoggedIn(callback) {
if (getToken()) {
console.log("you shldnt appear at all");
return app.api.get("user/me", function (error, data) {
console.log(error, data);
if (!error) app.auth.user = data;
return callback(error, data);
});
} else {
callback(null, false);
callback(true);
}
}