diff --git a/src/routes.js b/src/routes.js index 3bc5b288..5d2bfc56 100644 --- a/src/routes.js +++ b/src/routes.js @@ -147,6 +147,14 @@ module.exports = async ( return true; }; + const lastSeenMiddleware = (req, res, next) => { + const { authorization } = req.headers + const { path, method } = req + if (!unprotectedRoutes[method][path] && authorization && GunDB.isAuthenticated()) { + GunActions.setLastSeenApp() + } + } + const unlockWallet = password => new Promise((resolve, reject) => { try { @@ -303,6 +311,8 @@ module.exports = async ( } }); + app.use(lastSeenMiddleware); + app.use(["/ping"], responseTime()); /**