Cleanup oauth tokens cache
This commit is contained in:
parent
3cf198e4f4
commit
81c647ff19
|
@ -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}`)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue