From 6c9b9df7ed98502d6258ecfd86abd433395ce235 Mon Sep 17 00:00:00 2001 From: Bob Sun Date: Wed, 8 Mar 2017 20:39:08 -0800 Subject: [PATCH] Set minimum password length of generated password to six --- pass/Controllers/PasswordEditorTableViewController.swift | 2 +- pass/Helpers/Globals.swift | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/pass/Controllers/PasswordEditorTableViewController.swift b/pass/Controllers/PasswordEditorTableViewController.swift index cf9ab95..874e3e9 100644 --- a/pass/Controllers/PasswordEditorTableViewController.swift +++ b/pass/Controllers/PasswordEditorTableViewController.swift @@ -53,7 +53,7 @@ class PasswordEditorTableViewController: UITableViewController, FillPasswordTabl cell = fillPasswordCell! case .passwordLengthCell: passwordLengthCell = tableView.dequeueReusableCell(withIdentifier: "passwordLengthCell", for: indexPath) as? SliderTableViewCell - passwordLengthCell?.reset(title: "Length", minimumValue: 1, maximumValue: Globals.passwordMaximumLength, defaultValue: Globals.passwordDefaultLength) + passwordLengthCell?.reset(title: "Length", minimumValue: Globals.passwordMinimumLength, maximumValue: Globals.passwordMaximumLength, defaultValue: Globals.passwordDefaultLength) cell = passwordLengthCell! default: cell = tableView.dequeueReusableCell(withIdentifier: "textFieldCell", for: indexPath) as! ContentTableViewCell diff --git a/pass/Helpers/Globals.swift b/pass/Helpers/Globals.swift index 6b63372..0621464 100644 --- a/pass/Helpers/Globals.swift +++ b/pass/Helpers/Globals.swift @@ -24,8 +24,9 @@ class Globals { static let red = UIColor(red:1.00, green:0.23, blue:0.19, alpha:1.0) static let blue = UIColor(red:0.00, green:0.48, blue:1.00, alpha:1.0) - static let passwordMaximumLength = 32 - static let passwordDefaultLength = 16 + static let passwordMinimumLength = 6 + static let passwordMaximumLength = 24 + static let passwordDefaultLength = 16 private init() { } }