瀏覽代碼

Fix incorrect 2fa type detection

Neeraj Gupta 2 年之前
父節點
當前提交
35bb9284d6
共有 1 個文件被更改,包括 6 次插入1 次删除
  1. 6 1
      lib/models/code.dart

+ 6 - 1
lib/models/code.dart

@@ -115,7 +115,12 @@ class Code {
   }
   }
 
 
   static Type _getType(Uri uri) {
   static Type _getType(Uri uri) {
-    return uri.host == "totp" ? Type.totp : Type.hotp;
+    if (uri.host == "totp") {
+      return Type.totp;
+    } else if (uri.host == "hotp") {
+      return Type.hotp;
+    }
+    throw UnsupportedError("Unsupported format with host ${uri.host}");
   }
   }
 
 
   @override
   @override