Skip to content

Commit cdca9d2

Browse files
committed
Merge pull request ResearchKit#127 from EricSiegNW/bug/FPHS-562
FPHS 562
2 parents e42bb76 + 6d17ddf commit cdca9d2

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

APCAppCore/APCAppCore/Library/Categories/NSError+APCAdditions.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ FOUNDATION_EXPORT NSString * kAPCAccountAlreadyExistsErrorMessage;
4141
FOUNDATION_EXPORT NSString * kAPCAccountDoesNotExistErrorMessage;
4242
FOUNDATION_EXPORT NSString * kAPCBadEmailAddressErrorMessage;
4343
FOUNDATION_EXPORT NSString * kAPCBadPasswordErrorMessage;
44+
FOUNDATION_EXPORT NSString * kAPCBadPasswordWithDetailsErrorMessage;
4445
FOUNDATION_EXPORT NSString * kAPCNotReachableErrorMessage;
4546
FOUNDATION_EXPORT NSString * kAPCInvalidEmailAddressOrPasswordErrorMessage;
4647

APCAppCore/APCAppCore/Library/Categories/NSError+APCAdditions.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
NSString * kAPCAccountDoesNotExistErrorMessage;
4444
NSString * kAPCBadEmailAddressErrorMessage;
4545
NSString * kAPCBadPasswordErrorMessage;
46+
NSString * kAPCBadPasswordWithDetailsErrorMessage;
4647
NSString * kAPCNotReachableErrorMessage;
4748
NSString * kAPCInvalidEmailAddressOrPasswordErrorMessage;
4849

@@ -61,6 +62,7 @@ + (void)initialize
6162
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");
6263
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");
6364
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");
65+
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");
6466
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");
6567
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");
6668
}

APCAppCore/APCAppCore/Library/Categories/NSError+Bridge.m

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,13 @@ - (NSString*)bridgeErrorMessage
8787
}
8888
else if([errors valueForKey: kSageErrorPasswordKey])
8989
{
90-
message = kAPCBadPasswordErrorMessage;
90+
NSArray *passwordErrors = [errors valueForKey: kSageErrorPasswordKey];
91+
NSString *errorsString = [passwordErrors componentsJoinedByString:@", "];
92+
if (errorsString.length > 0) {
93+
message = [NSString stringWithFormat:kAPCBadPasswordWithDetailsErrorMessage, errorsString];
94+
} else {
95+
message = kAPCBadPasswordErrorMessage;
96+
}
9197
} else
9298
{
9399
message = kAPCInvalidEmailAddressOrPasswordErrorMessage;

0 commit comments

Comments
 (0)