mirror of
https://github.com/ente-io/ente.git
synced 2025-08-08 07:28:26 +00:00
[auth] Improve _getDigits
This commit is contained in:
parent
8bf9a2544c
commit
da45ea3173
@ -81,7 +81,7 @@ class Code {
|
|||||||
Algorithm.sha1,
|
Algorithm.sha1,
|
||||||
type,
|
type,
|
||||||
0,
|
0,
|
||||||
"otpauth://${type.name}/$issuer:$account?algorithm=SHA1${type == Type.steam ? "" : "&digits=$digits"}&issuer=$issuer&period=30&secret=$secret",
|
"otpauth://${type.name}/$issuer:$account?algorithm=SHA1&digits=$digits&issuer=$issuer&period=30&secret=$secret",
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -149,9 +149,11 @@ class Code {
|
|||||||
|
|
||||||
static int _getDigits(Uri uri, String issuer) {
|
static int _getDigits(Uri uri, String issuer) {
|
||||||
try {
|
try {
|
||||||
if (issuer.toLowerCase() == "steam") return steamDigits;
|
|
||||||
return int.parse(uri.queryParameters['digits']!);
|
return int.parse(uri.queryParameters['digits']!);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
if (issuer.toLowerCase() == "steam") {
|
||||||
|
return steamDigits;
|
||||||
|
}
|
||||||
return defaultDigits;
|
return defaultDigits;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user