checkLoggedIn.js 227 Bytes Raw Blame History Permalink 1 2 3 4 5 6 7 8 9 10 11 12 const checkLoggedIn = (ctx, next) => { if (!ctx.state.user) { //debug console.log('checkLoggedin error'); ctx.status = 401; return; } return next(); }; module.exports = checkLoggedIn;