Use uri.host instead of issuer in _GetDigits

This commit is contained in:
Vladyslav Pashynskykh 2024-05-22 13:51:07 +03:00
parent 70dc660f5a
commit 227b7ddba0
No known key found for this signature in database
GPG key ID: 6F8685377E0A9055

View file

@ -128,7 +128,7 @@ class Code {
final code = Code(
_getAccount(uri),
issuer,
_getDigits(uri, issuer),
_getDigits(uri),
_getPeriod(uri),
getSanitizedSecret(uri.queryParameters['secret']!),
_getAlgorithm(uri),
@ -201,11 +201,11 @@ class Code {
}
}
static int _getDigits(Uri uri, String issuer) {
static int _getDigits(Uri uri) {
try {
return int.parse(uri.queryParameters['digits']!);
} catch (e) {
if (issuer.toLowerCase() == "steam" || issuer.toLowerCase().contains('steampowered.com')) {
if (uri.host == "steam") {
return steamDigits;
}
return defaultDigits;