소스 검색

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) {
-    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