mirror of https://github.com/Chocobozzz/PeerTube
Cleanup oauth tokens cache
parent
3cf198e4f4
commit
81c647ff19
|
@ -105,6 +105,14 @@ async function onExternalUserAuthenticated (options: {
|
||||||
authName
|
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}`)
|
res.redirect(`/login?externalAuthToken=${bypassToken}&username=${user.username}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue