Skip to content

Commit

Permalink
CW-566-Cake2FA-Bypass-Bug (cake-tech#1275)
Browse files Browse the repository at this point in the history
* fix: TOTP 2FA Bug

* fix: key switch error

* Fix 2fa preset issue

---------

Co-authored-by: OmarHatem <omarh.ismail1@gmail.com>
  • Loading branch information
Blazebrain and OmarHatem28 committed Jan 27, 2024
1 parent fc352a6 commit f68987b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/store/settings_store.dart
Original file line number Diff line number Diff line change
Expand Up @@ -997,7 +997,7 @@ abstract class SettingsStoreBase with Store {
final totpSecretKey = await SecureKey.getString(
secureStorage: secureStorage,
sharedPreferences: sharedPreferences,
key: SecureKey.useTOTP2FA,
key: SecureKey.totpSecretKey,
) ??
'';

Expand Down Expand Up @@ -1243,7 +1243,7 @@ abstract class SettingsStoreBase with Store {
totpSecretKey = await SecureKey.getString(
secureStorage: _secureStorage,
sharedPreferences: sharedPreferences,
key: SecureKey.useTOTP2FA,
key: SecureKey.totpSecretKey,
) ??
totpSecretKey;

Expand Down
4 changes: 3 additions & 1 deletion lib/view_model/set_up_2fa_viewmodel.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ abstract class Setup2FAViewModelBase with Store {
unhighlightTabs = false,
selected2FASettings = ObservableList<VerboseControlSettings>(),
state = InitialExecutionState() {
selectCakePreset(selectedCake2FAPreset);
if (selectedCake2FAPreset != Cake2FAPresetsOptions.none) {
selectCakePreset(selectedCake2FAPreset);
}
reaction((_) => state, _saveLastAuthTime);
}

Expand Down

0 comments on commit f68987b

Please sign in to comment.