fix(core): Rate limit MFA activation and verification endpoints (#10330)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2024-08-08 15:01:07 +02:00
committed by GitHub
parent ee03400c25
commit b6c47c0e32

View File

@@ -47,7 +47,7 @@ export class MFAController {
}; };
} }
@Post('/enable') @Post('/enable', { rateLimit: true })
async activateMFA(req: MFA.Activate) { async activateMFA(req: MFA.Activate) {
const { token = null } = req.body; const { token = null } = req.body;
const { id, mfaEnabled } = req.user; const { id, mfaEnabled } = req.user;
@@ -78,7 +78,7 @@ export class MFAController {
await this.mfaService.disableMfa(id); await this.mfaService.disableMfa(id);
} }
@Post('/verify') @Post('/verify', { rateLimit: true })
async verifyMFA(req: MFA.Verify) { async verifyMFA(req: MFA.Verify) {
const { id } = req.user; const { id } = req.user;
const { token } = req.body; const { token } = req.body;