Ente Auth: Add support for Steam domain used as issuer
This commit is contained in:
parent
954581093d
commit
d75abcf6a7
3 changed files with 4 additions and 4 deletions
|
@ -205,7 +205,7 @@ class Code {
|
|||
try {
|
||||
return int.parse(uri.queryParameters['digits']!);
|
||||
} catch (e) {
|
||||
if (issuer.toLowerCase() == "steam") {
|
||||
if (issuer.toLowerCase() == "steam" || issuer.toLowerCase().contains('steampowered.com')) {
|
||||
return steamDigits;
|
||||
}
|
||||
return defaultDigits;
|
||||
|
|
|
@ -240,7 +240,7 @@ class _SetupEnterSecretKeyPageState extends State<SetupEnterSecretKeyPage> {
|
|||
final account = _accountController.text.trim();
|
||||
final issuer = _issuerController.text.trim();
|
||||
final secret = _secretController.text.trim().replaceAll(' ', '');
|
||||
final isStreamCode = issuer.toLowerCase() == "steam";
|
||||
final isStreamCode = issuer.toLowerCase() == "steam" || issuer.toLowerCase().contains('steampowered.com');
|
||||
if (widget.code != null && widget.code!.secret != secret) {
|
||||
ButtonResult? result = await showChoiceActionSheet(
|
||||
context,
|
||||
|
|
|
@ -4,7 +4,7 @@ import 'package:otp/otp.dart' as otp;
|
|||
import 'package:steam_totp/steam_totp.dart';
|
||||
|
||||
String getOTP(Code code) {
|
||||
if (['steam', 'steampowered.com'].contains(code.issuer.toLowerCase())) {
|
||||
if (code.type == Type.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 (['steam', 'steampowered.com'].contains(code.issuer.toLowerCase())) {
|
||||
if (code.type == Type.steam) {
|
||||
return _getSteamCode(code, true);
|
||||
}
|
||||
return otp.OTP.generateTOTPCodeString(
|
||||
|
|
Loading…
Reference in a new issue