namirasoft-node 1.4.98 → 1.4.99
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/OTPOperation.ts +7 -2
package/package.json
CHANGED
package/src/OTPOperation.ts
CHANGED
|
@@ -32,7 +32,12 @@ export class OTPOperation
|
|
|
32
32
|
return parseInt(wait_time + "");
|
|
33
33
|
}
|
|
34
34
|
static async onSafeRequest<T>(x_otp: string | null, x_otp_time: Date | string | null, x_otp_req_tried_count: number,
|
|
35
|
-
handler: (row: {
|
|
35
|
+
handler: (row: {
|
|
36
|
+
x_otp: string,
|
|
37
|
+
x_otp_time: Date,
|
|
38
|
+
x_otp_req_tried_count: number,
|
|
39
|
+
x_otp_ver_tried_count: number
|
|
40
|
+
}) => Promise<T>): Promise<T>
|
|
36
41
|
{
|
|
37
42
|
// check wait time
|
|
38
43
|
let wait_time = OTPOperation.getWaitTime(x_otp_req_tried_count);
|
|
@@ -68,7 +73,7 @@ export class OTPOperation
|
|
|
68
73
|
|
|
69
74
|
if (x_otp_time != null)
|
|
70
75
|
x_otp_time = new Date(x_otp_time);
|
|
71
|
-
|
|
76
|
+
|
|
72
77
|
if (x_otp_time < TimeOperation.minutesAgo(OTPOperation.OTP_EXPIRE_TIME, new Date()))
|
|
73
78
|
ErrorOperation.throwHTTP(403, "The OTP code expired. Please request again.");
|
|
74
79
|
|