mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
fix(core): Rate limit MFA activation and verification endpoints (#10330)
This commit is contained in:
parent
ee03400c25
commit
b6c47c0e32
|
@ -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;
|
||||||
|
|
Loading…
Reference in a new issue