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:
commit
7afd5582eb
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue