diff --git a/Lock/Base.lproj/Lock.strings b/Lock/Base.lproj/Lock.strings index 6949bed2c..9c4289a7b 100644 --- a/Lock/Base.lproj/Lock.strings +++ b/Lock/Base.lproj/Lock.strings @@ -16,6 +16,8 @@ "com.auth0.lock.database.separator" = "or"; // User signed up "com.auth0.lock.database.signup.success.message" = "Thanks for signing up."; +// Accept +"com.auth0.lock.database.tos.sheet.accept" = "Accept"; // Cancel "com.auth0.lock.database.tos.sheet.cancel" = "Cancel"; // Privacy diff --git a/Lock/DatabasePresenter.swift b/Lock/DatabasePresenter.swift index e7ee9ecb7..706c7b160 100644 --- a/Lock/DatabasePresenter.swift +++ b/Lock/DatabasePresenter.swift @@ -280,8 +280,8 @@ class DatabasePresenter: Presentable, Loggable { let alert = UIAlertController(title: terms, message: "By signing up, you agree to our terms of\n service and privacy policy".i18n(key: "com.auth0.lock.database.button.tos", comment: "tos & privacy"), preferredStyle: .alert) alert.popoverPresentationController?.sourceView = button alert.popoverPresentationController?.sourceRect = button.bounds - let cancelAction = UIAlertAction(title: "Cancel", style: .cancel, handler: nil) - let okAction = UIAlertAction(title: "Accept", style: .default) { _ in + let cancelAction = UIAlertAction(title: "Cancel".i18n(key: "com.auth0.lock.database.tos.sheet.cancel", comment: "Cancel"), style: .cancel, handler: nil) + let okAction = UIAlertAction(title: "Accept".i18n(key: "com.auth0.lock.database.tos.sheet.accept", comment: "Accept"), style: .default) { _ in successHandler(button) } [cancelAction, okAction].forEach { alert.addAction($0) } diff --git a/Lock/Validators.swift b/Lock/Validators.swift index 0259df59e..feb6f5292 100644 --- a/Lock/Validators.swift +++ b/Lock/Validators.swift @@ -130,7 +130,7 @@ public class PasswordPolicyValidator: InputValidator { func validate(_ value: String?) -> Error? { let result = self.policy.on(value) self.delegate?.update(withRules: result) - let valid = result.reduce(true) { $0 && $1.valid } + let valid = result.allSatisfy { $0.valid } guard !valid else { return nil } return InputValidationError.passwordPolicyViolation(result: result.filter { !$0.valid }) }