refactor: cache the token as long as possible

During installation, the salt is generated and remains constant unless
the user re-installs the FreshRSS instance.
This commit is contained in:
Heng-Yi Wu 2023-04-19 23:25:13 +08:00
parent 651e06aa25
commit 63e38a5fa7
No known key found for this signature in database
GPG Key ID: 3A63404431B91B99

View File

@ -27,7 +27,7 @@ async function login(widget, service) {
try {
const [, token] = data.toString().split("\n").find(line => line.startsWith("Auth=")).split("=")
cache.put(`${sessionTokenCacheKey}.${service}`, token, 30 * 60 * 1000); // 30m
cache.put(`${sessionTokenCacheKey}.${service}`, token);
return { token };
} catch (e) {
logger.error("Unable to login to FreshRSS API: %s", e);