Merge pull request #511 from padloc/feature/disable-mfa

Add flag to completely disable multi-factor authentication for a given account
This commit is contained in:
Martin Kleinschrodt 2022-07-28 10:33:19 +02:00 committed by GitHub
commit 7afd5582eb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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,