mirror of
https://github.com/fosrl/pangolin.git
synced 2025-08-30 14:39:29 +02:00
fix access token session do not extend and make domains lower case
This commit is contained in:
parent
9992abf65c
commit
35b67cd3cc
6 changed files with 42 additions and 32 deletions
|
@ -88,19 +88,20 @@ export async function validateResourceSessionToken(
|
|||
.where(eq(resourceSessions.sessionId, resourceSessions.sessionId));
|
||||
return { resourceSession: null };
|
||||
} else if (
|
||||
!resourceSession.doNotExtend &&
|
||||
Date.now() >=
|
||||
resourceSession.expiresAt - resourceSession.sessionLength / 2
|
||||
) {
|
||||
resourceSession.expiresAt = new Date(
|
||||
Date.now() + resourceSession.sessionLength
|
||||
).getTime();
|
||||
await db
|
||||
if (!resourceSession.doNotExtend) {
|
||||
resourceSession.expiresAt = new Date(
|
||||
Date.now() + resourceSession.sessionLength
|
||||
).getTime();
|
||||
await db
|
||||
.update(resourceSessions)
|
||||
.set({
|
||||
expiresAt: resourceSession.expiresAt
|
||||
})
|
||||
.where(eq(resourceSessions.sessionId, resourceSession.sessionId));
|
||||
}
|
||||
}
|
||||
|
||||
return { resourceSession };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue