You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/Adapters/Auth/mfa.js
+8-13Lines changed: 8 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -6,6 +6,7 @@
6
6
* @param {Array<String>} options.options - Supported MFA methods. Must include `"SMS"` or `"TOTP"`.
7
7
* @param {Number} [options.digits=6] - The number of digits for the one-time password (OTP). Must be between 4 and 10.
8
8
* @param {Number} [options.period=30] - The validity period of the OTP in seconds. Must be greater than 10.
9
+
* @param {Object} [options.period={TOTP:30,SMS:30,EMAIL:150}] - The validity period of the OTP in seconds for different mfa factors. Must be greater than 30.
9
10
* @param {String} [options.algorithm="SHA1"] - The algorithm used for TOTP generation. Defaults to `"SHA1"`.
10
11
* @param {Function} [options.sendSMS] - A callback function for sending SMS OTPs. Required if `"SMS"` is included in `options`.
11
12
*
@@ -92,7 +93,7 @@ class MFAAdapter extends AuthAdapter {
92
93
throw'mfa.options must include SMS or TOTP or EMAIL';
93
94
}
94
95
constdigits=opts.digits||6;
95
-
constperiod=opts.period||30;
96
+
this.period={};
96
97
97
98
// Define default periods for each method
98
99
constdefaultPeriods={
@@ -103,34 +104,29 @@ class MFAAdapter extends AuthAdapter {
0 commit comments