Handle steam code generation

This commit is contained in:
Neeraj Gupta
2024-06-04 12:29:34 +05:30
parent 0b626fc781
commit 9a921c314a

View File

@@ -4,7 +4,7 @@ import 'package:otp/otp.dart' as otp;
import 'package:steam_totp/steam_totp.dart';
String getOTP(Code code) {
if (code.type == Type.steam) {
if (code.type == Type.steam || code.issuer.toLowerCase() == 'steam') {
return _getSteamCode(code);
}
if (code.type == Type.hotp) {
@@ -39,7 +39,7 @@ String _getSteamCode(Code code, [bool isNext = false]) {
}
String getNextTotp(Code code) {
if (code.type == Type.steam) {
if (code.type == Type.steam || code.issuer.toLowerCase() == 'steam') {
return _getSteamCode(code, true);
}
return otp.OTP.generateTOTPCodeString(