mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-12-02 12:14:09 +01:00
fix: Cake-2FA-setup-issue (#1097)
* fix: Cake 2FA setup issue * fix: 2FA Setup issue * fix: 2FA setup bug
This commit is contained in:
@@ -280,14 +280,13 @@ abstract class SettingsStoreBase with Store {
|
||||
reaction(
|
||||
(_) => useTOTP2FA, (bool use) => sharedPreferences.setBool(PreferencesKey.useTOTP2FA, use));
|
||||
|
||||
reaction((_) => totpSecretKey,
|
||||
(String totpKey) => sharedPreferences.setString(PreferencesKey.totpSecretKey, totpKey));
|
||||
reaction(
|
||||
(_) => numberOfFailedTokenTrials,
|
||||
(int failedTokenTrail) =>
|
||||
sharedPreferences.setInt(PreferencesKey.failedTotpTokenTrials, failedTokenTrail));
|
||||
|
||||
reaction((_) => totpSecretKey,
|
||||
(String totpKey) => sharedPreferences.setString(PreferencesKey.totpSecretKey, totpKey));
|
||||
|
||||
reaction(
|
||||
(_) => shouldShowMarketPlaceInDashboard,
|
||||
(bool value) =>
|
||||
@@ -422,15 +421,10 @@ abstract class SettingsStoreBase with Store {
|
||||
bool shouldRequireTOTP2FAForAllSecurityAndBackupSettings;
|
||||
|
||||
@observable
|
||||
String totpSecretKey;
|
||||
|
||||
@computed
|
||||
String get totpVersionOneLink {
|
||||
return 'otpauth://totp/Cake%20Wallet:$deviceName?secret=$totpSecretKey&issuer=Cake%20Wallet&algorithm=SHA512&digits=8&period=30';
|
||||
}
|
||||
bool useTOTP2FA;
|
||||
|
||||
@observable
|
||||
bool useTOTP2FA;
|
||||
String totpSecretKey;
|
||||
|
||||
@observable
|
||||
int numberOfFailedTokenTrials;
|
||||
@@ -575,8 +569,8 @@ abstract class SettingsStoreBase with Store {
|
||||
final shouldRequireTOTP2FAForAllSecurityAndBackupSettings = sharedPreferences
|
||||
.getBool(PreferencesKey.shouldRequireTOTP2FAForAllSecurityAndBackupSettings) ??
|
||||
false;
|
||||
final totpSecretKey = sharedPreferences.getString(PreferencesKey.totpSecretKey) ?? '';
|
||||
final useTOTP2FA = sharedPreferences.getBool(PreferencesKey.useTOTP2FA) ?? false;
|
||||
final totpSecretKey = sharedPreferences.getString(PreferencesKey.totpSecretKey) ?? '';
|
||||
final tokenTrialNumber = sharedPreferences.getInt(PreferencesKey.failedTotpTokenTrials) ?? 0;
|
||||
final shouldShowMarketPlaceInDashboard =
|
||||
sharedPreferences.getBool(PreferencesKey.shouldShowMarketPlaceInDashboard) ?? true;
|
||||
@@ -677,8 +671,8 @@ abstract class SettingsStoreBase with Store {
|
||||
initialFiatMode: currentFiatApiMode,
|
||||
initialAllowBiometricalAuthentication: allowBiometricalAuthentication,
|
||||
initialCake2FAPresetOptions: selectedCake2FAPreset,
|
||||
initialTotpSecretKey: totpSecretKey,
|
||||
initialUseTOTP2FA: useTOTP2FA,
|
||||
initialTotpSecretKey: totpSecretKey,
|
||||
initialFailedTokenTrial: tokenTrialNumber,
|
||||
initialExchangeStatus: exchangeStatus,
|
||||
initialTheme: savedTheme,
|
||||
@@ -752,9 +746,8 @@ abstract class SettingsStoreBase with Store {
|
||||
shouldSaveRecipientAddress =
|
||||
sharedPreferences.getBool(PreferencesKey.shouldSaveRecipientAddressKey) ??
|
||||
shouldSaveRecipientAddress;
|
||||
totpSecretKey = sharedPreferences.getString(PreferencesKey.totpSecretKey) ?? totpSecretKey;
|
||||
useTOTP2FA = sharedPreferences.getBool(PreferencesKey.useTOTP2FA) ?? useTOTP2FA;
|
||||
|
||||
totpSecretKey = sharedPreferences.getString(PreferencesKey.totpSecretKey) ?? totpSecretKey;
|
||||
numberOfFailedTokenTrials =
|
||||
sharedPreferences.getInt(PreferencesKey.failedTotpTokenTrials) ?? numberOfFailedTokenTrials;
|
||||
isAppSecure = sharedPreferences.getBool(PreferencesKey.isAppSecureKey) ?? isAppSecure;
|
||||
|
||||
Reference in New Issue
Block a user