Last seen middleware
This commit is contained in:
parent
0116d817ef
commit
5dfbf9ec47
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} = req
|
||||||
|
if (!nonEncryptedRoutes.includes(path) && authorization) {
|
||||||
|
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