openvibers/openvibe.deals Commits

/auth/me is not counted by the sign-in limiter: 60 page views in 15 minutes made a signed-in visitor look signed out (#100)

OP OpenVibers committed 17 days ago · 9b5f5df183 · 1 file, +2 −1

Changes

ddiff --git a/server/app.js b/server/app.js
iindex c477d81..8d04971 100644
---- a/server/app.js
++++ b/server/app.js
@@@ -172,7 +172,8 @@ async function createApp(opts = {}) {
if (indexnow.enabled) app.use(indexnow.keyFile);
// ── Sign-in (OAuth2 client of OpenVibe.Network) ─────────
-- app.use('/auth/', rateLimit({ windowMs: 15 * 60_000, max: 60, standardHeaders: true, legacyHeaders: false }));
++ // /auth/me is the navbar's who-is-signed-in read on every page, so it is not counted with sign-ins: 60 page views in 15 minutes made a signed-in visitor look signed out.
++ app.use('/auth/', rateLimit({ windowMs: 15 * 60_000, max: 60, skip: (req) => req.path === '/me', standardHeaders: true, legacyHeaders: false }));
app.use('/auth', sso.router(express));
{ const legal = require('openvibe-shared/legal'); app.get(legal.PATHS, legal.handler({ id: 'deals', service: 'deals', host: 'openvibe.deals', name: 'OpenVibe.Deals', profile: 'ugc' })); }