diff --git a/internal/server/web/dist/index.html b/internal/server/web/dist/index.html index 5c62577e34fb15ec388e2aefb2c1b0225c33deda..845a5c6c6a85828a601188371a9a83695d295492 100644 --- a/internal/server/web/dist/index.html +++ b/internal/server/web/dist/index.html @@ -13,7 +13,7 @@ - + diff --git a/web/src/routes/auth.callback.tsx b/web/src/routes/auth.callback.tsx index 16a29c3558308566467f186224135188e020f496..5c7b4dcc05ac3f73c5ebdc6c4d8812925d292f8c 100644 --- a/web/src/routes/auth.callback.tsx +++ b/web/src/routes/auth.callback.tsx @@ -66,10 +66,14 @@ } } catch { log = [] } - log.push(Date.now()) + const now = Date.now() + // Prune entries outside the 5-minute window before appending so the + // array can't grow unbounded across many failed reloads. + log = log.filter(ts => ts > now - 300_000) + log.push(now) localStorage.setItem(FAILURES_KEY, JSON.stringify(log)) - const { blocked: isBlocked } = countCallbackFailures(Date.now(), log) + const { blocked: isBlocked } = countCallbackFailures(now, log) return isBlocked }