Skip to content

Commit

Permalink
Merge pull request ResearchKit#127 from EricSiegNW/bug/FPHS-562
Browse files Browse the repository at this point in the history
FPHS 562
  • Loading branch information
Erin-Mounts committed Jun 2, 2016
2 parents e42bb76 + 6d17ddf commit cdca9d2
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
Expand Up @@ -41,6 +41,7 @@ FOUNDATION_EXPORT NSString * kAPCAccountAlreadyExistsErrorMessage;
FOUNDATION_EXPORT NSString * kAPCAccountDoesNotExistErrorMessage;
FOUNDATION_EXPORT NSString * kAPCBadEmailAddressErrorMessage;
FOUNDATION_EXPORT NSString * kAPCBadPasswordErrorMessage;
FOUNDATION_EXPORT NSString * kAPCBadPasswordWithDetailsErrorMessage;
FOUNDATION_EXPORT NSString * kAPCNotReachableErrorMessage;
FOUNDATION_EXPORT NSString * kAPCInvalidEmailAddressOrPasswordErrorMessage;

Expand Down
Expand Up @@ -43,6 +43,7 @@
NSString * kAPCAccountDoesNotExistErrorMessage;
NSString * kAPCBadEmailAddressErrorMessage;
NSString * kAPCBadPasswordErrorMessage;
NSString * kAPCBadPasswordWithDetailsErrorMessage;
NSString * kAPCNotReachableErrorMessage;
NSString * kAPCInvalidEmailAddressOrPasswordErrorMessage;

Expand All @@ -61,6 +62,7 @@ + (void)initialize
kAPCAccountDoesNotExistErrorMessage = NSLocalizedStringWithDefaultValue(@"There is no account registered for this email address and password combination.", @"APCAppCore", APCBundle(), @"There is no account registered for this email address and password combination.", @"Error message when participant attempts to sign in to an existing account with an incorrect email address or password");
kAPCBadEmailAddressErrorMessage = NSLocalizedStringWithDefaultValue(@"The email address submitted is not a valid email address. Please correct the email address and try again.", @"APCAppCore", APCBundle(), @"The email address submitted is not a valid email address. Please correct the email address and try again.", @"Error message when participant attempts to sign up using a non-valid email address");
kAPCBadPasswordErrorMessage = NSLocalizedStringWithDefaultValue(@"The password you have entered is not a valid password. Please try again.", @"APCAppCore", APCBundle(), @"The password you have entered is not a valid password. Please try again.", @"Error message when participant attempts to sign up with a non-valid password");
kAPCBadPasswordWithDetailsErrorMessage = NSLocalizedStringWithDefaultValue(@"The password you have entered is not a valid password. Please try again. Details: %@", @"APCAppCore", APCBundle(), @"The password you have entered is not a valid password. Please try again. Details: %@", @"Format for error message when participant attempts to sign up with a non-valid password, to be filled in with specifics of why it's not valid from the server error message");
kAPCNotReachableErrorMessage = NSLocalizedStringWithDefaultValue(@"We are currently not able to reach the study server. Please retry in a few moments.", @"APCAppCore", APCBundle(), @"We are currently not able to reach the study server. Please retry in a few moments.", @"Error message when the app is unable to reach the Bridge server");
kAPCInvalidEmailAddressOrPasswordErrorMessage = NSLocalizedStringWithDefaultValue(@"Entered email address or password is not valid. Please correct the email address or password and try again.", @"APCAppCore", APCBundle(), @"Entered email address or password is not valid. Please correct the email address or password and try again.", @"Error message when participant attempts to sign up with a non-valid email address or password");
}
Expand Down
8 changes: 7 additions & 1 deletion APCAppCore/APCAppCore/Library/Categories/NSError+Bridge.m
Expand Up @@ -87,7 +87,13 @@ - (NSString*)bridgeErrorMessage
}
else if([errors valueForKey: kSageErrorPasswordKey])
{
message = kAPCBadPasswordErrorMessage;
NSArray *passwordErrors = [errors valueForKey: kSageErrorPasswordKey];
NSString *errorsString = [passwordErrors componentsJoinedByString:@", "];
if (errorsString.length > 0) {
message = [NSString stringWithFormat:kAPCBadPasswordWithDetailsErrorMessage, errorsString];
} else {
message = kAPCBadPasswordErrorMessage;
}
} else
{
message = kAPCInvalidEmailAddressOrPasswordErrorMessage;
Expand Down

0 comments on commit cdca9d2

Please sign in to comment.