Ente Auth: Add support for Steam domain used as issuer

This commit is contained in:
Vladyslav Pashynskykh 2024-05-22 09:51:12 +03:00
parent f60e750848
commit 954581093d
No known key found for this signature in database
GPG key ID: 6F8685377E0A9055

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.issuer.toLowerCase() == 'steam') {
if (['steam', 'steampowered.com'].contains(code.issuer.toLowerCase())) {
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.issuer.toLowerCase() == 'steam') {
if (['steam', 'steampowered.com'].contains(code.issuer.toLowerCase())) {
return _getSteamCode(code, true);
}
return otp.OTP.generateTOTPCodeString(