mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-15 14:43:46 +01:00
Merge pull request #16000 from overleaf/jpa-web-join-project-rate-limit-per-user-id
[web] apply rate limit for joinProject per user-id and project-id GitOrigin-RevId: d03a81f4ff55d9a8f6d4ea4ca3633e3682e6dacb
This commit is contained in:
@@ -58,7 +58,7 @@ const unsupportedSpellcheckLanguages = [
|
|||||||
|
|
||||||
async function joinProject(req, res, next) {
|
async function joinProject(req, res, next) {
|
||||||
const projectId = req.params.Project_id
|
const projectId = req.params.Project_id
|
||||||
let userId = req.query.user_id
|
let userId = req.query.user_id // keep schema in sync with router
|
||||||
if (userId === 'anonymous-user') {
|
if (userId === 'anonymous-user') {
|
||||||
userId = null
|
userId = null
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -70,6 +70,8 @@ module.exports = {
|
|||||||
AuthenticationController.requirePrivateApiAuth(),
|
AuthenticationController.requirePrivateApiAuth(),
|
||||||
RateLimiterMiddleware.rateLimit(rateLimiters.joinProject, {
|
RateLimiterMiddleware.rateLimit(rateLimiters.joinProject, {
|
||||||
params: ['Project_id'],
|
params: ['Project_id'],
|
||||||
|
// keep schema in sync with controller
|
||||||
|
getUserId: req => req.query.user_id,
|
||||||
}),
|
}),
|
||||||
EditorHttpController.joinProject
|
EditorHttpController.joinProject
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user