Skip to content

Commit

Permalink
Allow user to clear secret field (#57)
Browse files Browse the repository at this point in the history
  • Loading branch information
KatherineInCode authored Apr 23, 2024
1 parent 58abcdd commit d7b0cb9
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ final class EditAuthenticatorItemProcessor: StateProcessor<
case let .periodChanged(period):
state.period = period
case let .secretChanged(secret):
state.secret = secret
state.totpState = LoginTOTPState(secret)
case let .toggleSecretVisibilityChanged(isVisible):
state.isSecretVisible = isVisible
Expand Down Expand Up @@ -130,6 +131,8 @@ final class EditAuthenticatorItemProcessor: StateProcessor<
do {
try EmptyInputValidator(fieldName: Localizations.name)
.validate(input: state.issuer)
try EmptyInputValidator(fieldName: Localizations.authenticatorKey)
.validate(input: state.secret)
coordinator.showLoadingOverlay(title: Localizations.saving)
switch state.configuration {
case .add:
Expand Down

0 comments on commit d7b0cb9

Please sign in to comment.