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
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

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