[auth] Fix steam import from 2fas

This commit is contained in:
Neeraj Gupta 2024-08-24 14:22:35 +05:30
parent 5a35edbbab
commit 724dcd97c1

View File

@ -152,14 +152,14 @@ Future<int?> _process2FasExportFile(
// Build the OTP URL
String otpUrl;
if (kind.toLowerCase() == 'totp') {
if (kind.toLowerCase() == 'totp' || kind.toLowerCase() == 'steam') {
otpUrl =
'otpauth://$kind/$issuer:$account?secret=$secret&issuer=$issuer&algorithm=$algorithm&digits=$digits&period=$timer';
} else if (kind.toLowerCase() == 'hotp') {
otpUrl =
'otpauth://$kind/$issuer:$account?secret=$secret&issuer=$issuer&algorithm=$algorithm&digits=$digits&counter=$counter';
} else {
throw Exception('Invalid OTP type');
throw Exception('Invalid OTP type ${kind.toLowerCase()}');
}
parsedCodes.add(Code.fromOTPAuthUrl(otpUrl));
}