Add flag to completely disable multi-factor authentication for a given account

This commit is contained in:
Martin Kleinschrodt 2022-07-28 09:45:15 +02:00
parent 908b855948
commit 7e7d6c770c
2 changed files with 5 additions and 1 deletions

View File

@ -231,6 +231,9 @@ export class Auth extends Serializable implements Storable {
@AsSerializable(PBES2Container)
legacyData?: PBES2Container;
/** Completely disables mfa for a given account. Only use for testing! */
disableMFA = false;
constructor(public email: string = "") {
super();
}

View File

@ -355,7 +355,8 @@ export class Controller extends API {
auth.authRequests.push(request);
const deviceTrusted =
this.context.device && auth.trustedDevices.some(({ id }) => id === this.context.device!.id);
auth.disableMFA ||
(this.context.device && auth.trustedDevices.some(({ id }) => id === this.context.device!.id));
const response = new StartAuthRequestResponse({
id: request.id,