Browse Source

remove useless async TotpChecker

isundil 1 month ago
parent
commit
b868fc20c8
5 changed files with 4 additions and 4 deletions
  1. 1 1
      dist/totpChecker.d.ts
  2. 1 1
      dist/totpChecker.d.ts.map
  3. 1 1
      dist/totpChecker.js
  4. 0 0
      dist/totpChecker.js.map
  5. 1 1
      src/totpChecker.ts

+ 1 - 1
dist/totpChecker.d.ts

@@ -13,7 +13,7 @@ export interface ToTpSecretAndUrl {
     secret: string;
 }
 export declare class TotpChecker {
-    static ValidateTotp(totpSecret: string | null, code: string | undefined, period?: number, digits?: number, algorithm?: TotpAlgorithm): Promise<boolean>;
+    static ValidateTotp(totpSecret: string | null, code: string | undefined, period?: number, digits?: number, algorithm?: TotpAlgorithm): boolean;
     private static DoGenerateCode;
     private static getCurrentPeriod;
     static GenerateCode(totpSecret: string, period?: number, digits?: number, algorithm?: TotpAlgorithm): string;

+ 1 - 1
dist/totpChecker.d.ts.map

@@ -1 +1 @@
-{"version":3,"file":"totpChecker.d.ts","sourceRoot":"","sources":["../src/totpChecker.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,SAAS,GAAG,SAAS,CAAC;AAE5D,MAAM,WAAW,oBAAoB;IACjC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,aAAa,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,gBAAgB;IAC7B,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;CAClB;AAID,qBAAa,WAAW;WACA,YAAY,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,EAAE,IAAI,EAAE,MAAM,GAAG,SAAS,EAAE,MAAM,CAAC,EAAE,MAAM,EAA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AAC,UAAU,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,aAAa,GAAG,MAAM;WAIrG,cAAc,CAAC,YAAY,CAAC,EAAC,MAAM;WAInC,WAAW,CAAC,eAAe,EAAE,oBAAoB,GAAG,MAAM,GAAG,gBAAgB;CAa9F"}

+ 1 - 1
dist/totpChecker.js

@@ -2,7 +2,7 @@ import base32Decode from 'base32-decode';
 import crypto from 'crypto';
 const RFC_4648 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";
 export class TotpChecker {
-    static async ValidateTotp(totpSecret, code, period, digits, algorithm) {
+    static ValidateTotp(totpSecret, code, period, digits, algorithm) {
         if (!totpSecret && !code)
             return true;
         if ((!totpSecret && code) || (totpSecret && !code))

File diff suppressed because it is too large
+ 0 - 0
dist/totpChecker.js.map


+ 1 - 1
src/totpChecker.ts

@@ -22,7 +22,7 @@ export interface ToTpSecretAndUrl {
 const RFC_4648 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";
 
 export class TotpChecker {
-    public static async ValidateTotp(totpSecret: string | null, code: string | undefined, period?: number, digits?: number, algorithm?: TotpAlgorithm): Promise<boolean> {
+    public static ValidateTotp(totpSecret: string | null, code: string | undefined, period?: number, digits?: number, algorithm?: TotpAlgorithm): boolean {
         if (!totpSecret && !code)
             return true;
         if ((!totpSecret && code) || (totpSecret && !code))

Some files were not shown because too many files changed in this diff