mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-16 09:36:44 +00:00
fix: Require mfa code to disable mfa (#10345)
This commit is contained in:
@@ -24,7 +24,7 @@ import { UserRepository } from '@/databases/repositories/user.repository';
|
||||
import { isApiEnabled } from '@/PublicApi';
|
||||
import { EventService } from '@/events/event.service';
|
||||
import { MfaService } from '@/Mfa/mfa.service';
|
||||
import { ForbiddenError } from '@/errors/response-errors/forbidden.error';
|
||||
import { InvalidMfaCodeError } from '@/errors/response-errors/invalid-mfa-code.error';
|
||||
|
||||
export const API_KEY_PREFIX = 'n8n_api_';
|
||||
|
||||
@@ -155,7 +155,7 @@ export class MeController {
|
||||
|
||||
const isMfaTokenValid = await this.mfaService.validateMfa(user.id, mfaCode, undefined);
|
||||
if (!isMfaTokenValid) {
|
||||
throw new ForbiddenError('Invalid two-factor code.');
|
||||
throw new InvalidMfaCodeError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user