Skip to content

Commit 2071b3c

Browse files
committed
fix: refactor
1 parent 37d3959 commit 2071b3c

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

src/Adapters/Auth/mfa.js

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -269,22 +269,20 @@ class MFAAdapter extends AuthAdapter {
269269
if (req.master) {
270270
return;
271271
}
272+
273+
let type;
272274
if (this.totp && authData.secret) {
273-
return {
274-
status: 'enabled',
275-
type: 'TOTP',
276-
};
275+
type = 'TOTP';
276+
} else if (this.sms && authData.mobile) {
277+
type = 'SMS';
278+
} else if (this.email && authData.email) {
279+
type = 'EMAIL';
277280
}
278-
if (this.sms && authData.mobile) {
279-
return {
280-
status: 'enabled',
281-
type: 'SMS',
282-
};
283-
}
284-
if (this.email && authData.email) {
281+
282+
if (type) {
285283
return {
286284
status: 'enabled',
287-
type: 'EMAIL',
285+
type,
288286
};
289287
}
290288
return {

0 commit comments

Comments
 (0)