Merge pull request #59 from shocknet/feature/last-seen-middleware
Last seen middleware
This commit is contained in:
commit
56ed910e69
1 changed files with 10 additions and 0 deletions
|
|
@ -147,6 +147,14 @@ module.exports = async (
|
||||||
return true;
|
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 =>
|
const unlockWallet = password =>
|
||||||
new Promise((resolve, reject) => {
|
new Promise((resolve, reject) => {
|
||||||
try {
|
try {
|
||||||
|
|
@ -303,6 +311,8 @@ module.exports = async (
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
app.use(lastSeenMiddleware);
|
||||||
|
|
||||||
app.use(["/ping"], responseTime());
|
app.use(["/ping"], responseTime());
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue