Skip to content
Browse files

Require passwords >=6 when registering

  • Loading branch information...
1 parent a9fdc48 commit a96bc120d031d038193b68dde2201ec675315e81 @BaseInfinity BaseInfinity committed Oct 13, 2012
Showing with 12 additions and 4 deletions.
  1. +12 −4 Classes/LoginViewController.m
View
16 Classes/LoginViewController.m
@@ -506,17 +506,25 @@ - (void)sendRegister {
otherButtonTitles:@"Okay", nil];
[alert show];
[alert release];
- }
- else if (![passwordVerifyField.text isEqual:passwordField.text]) {
+ } else if ([[passwordField.text stringByTrimmingCharactersInSet:
+ [NSCharacterSet whitespaceAndNewlineCharacterSet]] length] < 6) {
+ UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Error"
+ message:@"Passwords must be at least 6 characters and contain a non-space character."
+ delegate:nil
+ cancelButtonTitle:nil
+ otherButtonTitles:@"Okay", nil];
+ [alert show];
+ [alert release];
+
+ } else if (![passwordVerifyField.text isEqual:passwordField.text]) {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Error"
message:@"Passwords don't match"
delegate:nil
cancelButtonTitle:nil
otherButtonTitles:@"Okay", nil];
[alert show];
[alert release];
- }
- else {
+ } else {
[self showLoading];
[[iFixitAPI sharedInstance] registerWithLogin:emailField.text
andPassword:passwordField.text

0 comments on commit a96bc12

Please sign in to comment.
Something went wrong with that request. Please try again.