mirror of
https://github.com/ente-io/ente.git
synced 2025-08-08 07:28:26 +00:00
fix: use steam digits instead of hardcoding it everywhere
This commit is contained in:
parent
e84b9da35e
commit
e4ea377ee0
@ -9,7 +9,8 @@ String getOTP(Code code) {
|
||||
return otp.OTP.generateTOTPCodeString(
|
||||
getSanitizedSecret(code.secret),
|
||||
DateTime.now().millisecondsSinceEpoch,
|
||||
length: code.issuer.toLowerCase() == "steam" ? 5 : code.digits,
|
||||
length:
|
||||
code.issuer.toLowerCase() == "steam" ? Code.steamDigits : code.digits,
|
||||
interval: code.period,
|
||||
algorithm: _getAlgorithm(code),
|
||||
isGoogle: true,
|
||||
@ -20,7 +21,8 @@ String _getHOTPCode(Code code) {
|
||||
return otp.OTP.generateHOTPCodeString(
|
||||
getSanitizedSecret(code.secret),
|
||||
code.counter,
|
||||
length: code.issuer.toLowerCase() == "steam" ? 5 : code.digits,
|
||||
length:
|
||||
code.issuer.toLowerCase() == "steam" ? Code.steamDigits : code.digits,
|
||||
algorithm: _getAlgorithm(code),
|
||||
isGoogle: true,
|
||||
);
|
||||
@ -30,7 +32,8 @@ String getNextTotp(Code code) {
|
||||
return otp.OTP.generateTOTPCodeString(
|
||||
getSanitizedSecret(code.secret),
|
||||
DateTime.now().millisecondsSinceEpoch + code.period * 1000,
|
||||
length: code.issuer.toLowerCase() == "steam" ? 5 : code.digits,
|
||||
length:
|
||||
code.issuer.toLowerCase() == "steam" ? Code.steamDigits : code.digits,
|
||||
interval: code.period,
|
||||
algorithm: _getAlgorithm(code),
|
||||
isGoogle: true,
|
||||
|
Loading…
x
Reference in New Issue
Block a user