projects
/
oweals
/
peertube.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3cf198e
)
Cleanup oauth tokens cache
author
Chocobozzz
<me@florianbigard.com>
Mon, 11 May 2020 06:40:38 +0000
(08:40 +0200)
committer
Chocobozzz
<me@florianbigard.com>
Mon, 11 May 2020 06:40:38 +0000
(08:40 +0200)
server/lib/auth.ts
patch
|
blob
|
history
diff --git
a/server/lib/auth.ts
b/server/lib/auth.ts
index 7c1dd1139b4ba9cb00a553f678d345ed7ecce485..8579bdbb44401e0f6fe0b1d4d5e82b54284a0ff8 100644
(file)
--- a/
server/lib/auth.ts
+++ b/
server/lib/auth.ts
@@
-105,6
+105,14
@@
async function onExternalUserAuthenticated (options: {
authName
})
+ // Cleanup
+ const now = new Date()
+ for (const [ key, value ] of authBypassTokens) {
+ if (value.expires.getTime() < now.getTime()) {
+ authBypassTokens.delete(key)
+ }
+ }
+
res.redirect(`/login?externalAuthToken=${bypassToken}&username=${user.username}`)
}