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 CHANGED
@@ -8,7 +8,7 @@
8
8
  "framework": "npm",
9
9
  "application": "package",
10
10
  "private": false,
11
- "version": "1.4.98",
11
+ "version": "1.4.99",
12
12
  "author": "Amir Abolhasani",
13
13
  "license": "MIT",
14
14
  "main": "./dist/index.js",
@@ -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: { x_otp: string, x_otp_time: Date | string, x_otp_req_tried_count: number, x_otp_ver_tried_count: number }) => Promise<T>): Promise<T>
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