diff options
Diffstat (limited to 'server')
-rw-r--r-- | server/lib/auth.ts | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/server/lib/auth.ts b/server/lib/auth.ts index 7c1dd1139..8579bdbb4 100644 --- a/server/lib/auth.ts +++ b/server/lib/auth.ts | |||
@@ -105,6 +105,14 @@ async function onExternalUserAuthenticated (options: { | |||
105 | authName | 105 | authName |
106 | }) | 106 | }) |
107 | 107 | ||
108 | // Cleanup | ||
109 | const now = new Date() | ||
110 | for (const [ key, value ] of authBypassTokens) { | ||
111 | if (value.expires.getTime() < now.getTime()) { | ||
112 | authBypassTokens.delete(key) | ||
113 | } | ||
114 | } | ||
115 | |||
108 | res.redirect(`/login?externalAuthToken=${bypassToken}&username=${user.username}`) | 116 | res.redirect(`/login?externalAuthToken=${bypassToken}&username=${user.username}`) |
109 | } | 117 | } |
110 | 118 | ||