From 954581093dd751fecf3d823985a8dac00ce74dfc Mon Sep 17 00:00:00 2001 From: Vladyslav Pashynskykh Date: Wed, 22 May 2024 09:51:12 +0300 Subject: [PATCH] Ente Auth: Add support for Steam domain used as issuer --- auth/lib/utils/totp_util.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/auth/lib/utils/totp_util.dart b/auth/lib/utils/totp_util.dart index d0076ed41..1b0c874bd 100644 --- a/auth/lib/utils/totp_util.dart +++ b/auth/lib/utils/totp_util.dart @@ -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(