diff options
author | Zsika Phillip <protocol86@users.noreply.github.com> | 2017-08-23 09:02:50 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-23 09:02:50 -0700 |
commit | 768c4058f3489917be7d433ad685b2f16d59aac4 (patch) | |
tree | a9ad6d452b03f518aae669316426eb3b3cbc45fa /Firebase/Auth/Source/FIRAuthErrorUtils.m | |
parent | 6e12c501f8dde3057d26149826e82489e114b2a1 (diff) |
Adds reCAPTCHA Token (#211)
* Adds reCAPTCHA Token to the "send verification code" request.
Diffstat (limited to 'Firebase/Auth/Source/FIRAuthErrorUtils.m')
-rw-r--r-- | Firebase/Auth/Source/FIRAuthErrorUtils.m | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/Firebase/Auth/Source/FIRAuthErrorUtils.m b/Firebase/Auth/Source/FIRAuthErrorUtils.m index 42fb543..0439f81 100644 --- a/Firebase/Auth/Source/FIRAuthErrorUtils.m +++ b/Firebase/Auth/Source/FIRAuthErrorUtils.m @@ -339,6 +339,12 @@ static NSString *const kFIRAuthErrorMessageAppNotVerified = @"Firebase could not "silent push notification and therefore could not verify your app. Ensure that you configured " "your app correctly to recieve push notifications."; +/** @var kFIRAuthErrorMessageCaptchaCheckFailed + @brief Message for @c FIRAuthErrorCodeCaptchaCheckFailed error code. + */ +static NSString *const kFIRAuthErrorMessageCaptchaCheckFailed = @"The reCAPTCHA response token " + "provided is either invalid, expired or already"; + /** @var kFIRAuthErrorMessageInternalError @brief Message for @c FIRAuthErrorCodeInternalError error code. */ @@ -447,6 +453,8 @@ static NSString *FIRAuthErrorDescription(FIRAuthErrorCode code) { return kFIRAuthErrorMessageNotificationNotForwarded; case FIRAuthErrorCodeAppNotVerified: return kFIRAuthErrorMessageAppNotVerified; + case FIRAuthErrorCodeCaptchaCheckFailed: + return kFIRAuthErrorMessageCaptchaCheckFailed; } } @@ -552,6 +560,8 @@ static NSString *const FIRAuthErrorCodeString(FIRAuthErrorCode code) { return @"ERROR_NOTIFICATION_NOT_FORWARDED"; case FIRAuthErrorCodeAppNotVerified: return @"ERROR_APP_NOT_VERIFIED"; + case FIRAuthErrorCodeCaptchaCheckFailed: + return @"ERROR_CAPTCHA_CHECK_FAILED"; } } @@ -859,6 +869,10 @@ static NSString *const FIRAuthErrorCodeString(FIRAuthErrorCode code) { return [self errorWithCode:FIRAuthInternalErrorCodeAppNotVerified message:message]; } ++ (NSError *)captchaCheckFailedErrorWithMessage:(nullable NSString *)message { + return [self errorWithCode:FIRAuthInternalErrorCodeCaptchaCheckFailed message:message]; +} + + (NSError *)keychainErrorWithFunction:(NSString *)keychainFunction status:(OSStatus)status { NSString *failureReason = [NSString stringWithFormat:@"%@ (%li)", keychainFunction, (long)status]; return [self errorWithCode:FIRAuthInternalErrorCodeKeychainError userInfo:@{ |