π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
[auth] Handle case when issuer contains :
Neeraj Gupta2c4cbed467e5
diff --git a/auth/lib/models/code.dart b/auth/lib/models/code.dartindex 4ecb4213d4..794a21276e 100644--- a/auth/lib/models/code.dart+++ b/auth/lib/models/code.dart@@ -132,7 +132,7 @@ class Code {static Code fromOTPAuthUrl(String rawData, {CodeDisplay? display}) {Uri uri = Uri.parse(rawData);final issuer = _getIssuer(uri);- final account = _getAccount(uri);+ final account = _getAccount(uri, issuer);try {final code = Code(@@ -163,7 +163,7 @@ class Code {}}- static String _getAccount(Uri uri) {+ static String _getAccount(Uri uri, String issuer) {try {String path = Uri.decodeComponent(uri.path);if (path.startsWith("/")) {@@ -174,6 +174,10 @@ class Code {if (uri.queryParameters.containsKey("issuer") && !path.contains(":")) {return path;}+ // handle case where issuer name contains colon+ if (path.startsWith('$issuer:')) {+ return path.substring(issuer.length + 1);+ }return path.substring(path.indexOf(':') + 1); // return data after first colon} catch (e, s) {