SessionManager: Fix session expiration check
This bug was introduced in8b0baa9679
. (cherry picked from commit3886e95c83
)
This commit is contained in:
parent
df7fa1fd41
commit
2249b9ae19
1 changed files with 1 additions and 1 deletions
|
@ -72,7 +72,7 @@ exports.findAuthorID = async (groupID, sessionCookie) => {
|
||||||
return undefined;
|
return undefined;
|
||||||
});
|
});
|
||||||
const now = Math.floor(Date.now() / 1000);
|
const now = Math.floor(Date.now() / 1000);
|
||||||
const isMatch = (si) => (si != null && si.groupID === groupID && si.validUntil <= now);
|
const isMatch = (si) => (si != null && si.groupID === groupID && now < si.validUntil);
|
||||||
const sessionInfo = await promises.firstSatisfies(sessionInfoPromises, isMatch);
|
const sessionInfo = await promises.firstSatisfies(sessionInfoPromises, isMatch);
|
||||||
if (sessionInfo == null) return undefined;
|
if (sessionInfo == null) return undefined;
|
||||||
return sessionInfo.authorID;
|
return sessionInfo.authorID;
|
||||||
|
|
Loading…
Reference in a new issue