protected session expiration timer moved to backend, closes #2847

This commit is contained in:
zadam
2022-05-13 23:20:56 +02:00
parent 8318ab7ac0
commit e87e065100
5 changed files with 34 additions and 17 deletions

View File

@@ -83,6 +83,10 @@ function logoutFromProtectedSession() {
ws.sendMessageToAllClients({ type: 'protectedSessionLogout' });
}
function touchProtectedSession() {
protectedSessionService.touchProtectedSession();
}
function token(req) {
const password = req.body.password;
@@ -92,7 +96,7 @@ function token(req) {
// for backwards compatibility with Sender which does not send the name
const tokenName = req.body.tokenName || "Trilium Sender / Web Clipper";
const {authToken} = etapiTokenService.createToken(tokenName);
return { token: authToken };
@@ -102,5 +106,6 @@ module.exports = {
loginSync,
loginToProtectedSession,
logoutFromProtectedSession,
touchProtectedSession,
token
};