aboutsummaryrefslogtreecommitdiffhomepage
path: root/Firebase/Auth/Source/FIRAuthErrorUtils.m
diff options
context:
space:
mode:
authorGravatar Zsika Phillip <protocol86@users.noreply.github.com>2018-04-03 17:19:51 -0700
committerGravatar GitHub <noreply@github.com>2018-04-03 17:19:51 -0700
commit6566328dc461c38c6000c64996c17883b9895d06 (patch)
tree1f072d106b95e87fbd9d163194d08c3a76977e07 /Firebase/Auth/Source/FIRAuthErrorUtils.m
parent1be9737fb28deb388cbcfaf6324ebad49683340b (diff)
Adds copy auth state API (#1018)
* Adds copy auth state API * improvements * Addresses comments
Diffstat (limited to 'Firebase/Auth/Source/FIRAuthErrorUtils.m')
-rw-r--r--Firebase/Auth/Source/FIRAuthErrorUtils.m19
1 files changed, 17 insertions, 2 deletions
diff --git a/Firebase/Auth/Source/FIRAuthErrorUtils.m b/Firebase/Auth/Source/FIRAuthErrorUtils.m
index 3748048..f4dbb94 100644
--- a/Firebase/Auth/Source/FIRAuthErrorUtils.m
+++ b/Firebase/Auth/Source/FIRAuthErrorUtils.m
@@ -139,8 +139,9 @@ static NSString *const kFIRAuthErrorMessageNoSuchProvider = @"User was not linke
/** @var kFIRAuthErrorMessageInvalidUserToken
@brief Message for @c FIRAuthErrorCodeInvalidUserToken error code.
*/
-static NSString *const kFIRAuthErrorMessageInvalidUserToken = @"The user's credential is no longer "
- "valid. The user must sign in again.";
+static NSString *const kFIRAuthErrorMessageInvalidUserToken = @"This user's credential isn't valid "
+ "for this project. This can happen if the user's token has been tampered with, or if the user "
+ "doesn’t belong to the project associated with the API key used in your request.";
/** @var kFIRAuthErrorMessageNetworkError
@brief Message for @c FIRAuthErrorCodeNetworkError error code.
@@ -400,6 +401,12 @@ static NSString *const kFIRAuthErrorMessageWebInternalError = @"An internal erro
static NSString *const kFIRAuthErrorMessageAppVerificationUserInteractionFailure = @"The app "
"verification process has failed, print and inspect the error details for more information";
+/** @var kFIRAuthErrorMessageNullUser
+ @brief Message for @c FIRAuthErrorCodeNullUser error code.
+ */
+static NSString *const kFIRAuthErrorMessageNullUser = @"A null user object was provided as the "
+ "argument for an operation which requires a non-null user object.";
+
/** @var kFIRAuthErrorMessageInternalError
@brief Message for @c FIRAuthErrorCodeInternalError error code.
*/
@@ -520,6 +527,8 @@ static NSString *FIRAuthErrorDescription(FIRAuthErrorCode code) {
return kFIRAuthErrorMessageAppVerificationUserInteractionFailure;
case FIRAuthErrorCodeWebNetworkRequestFailed:
return kFIRAuthErrorMessageWebRequestFailed;
+ case FIRAuthErrorCodeNullUser:
+ return kFIRAuthErrorMessageNullUser;
case FIRAuthErrorCodeWebInternalError:
return kFIRAuthErrorMessageWebInternalError;
}
@@ -639,6 +648,8 @@ static NSString *const FIRAuthErrorCodeString(FIRAuthErrorCode code) {
return @"ERROR_APP_VERIFICATION_FAILED";
case FIRAuthErrorCodeWebNetworkRequestFailed:
return @"ERROR_WEB_NETWORK_REQUEST_FAILED";
+ case FIRAuthErrorCodeNullUser:
+ return @"ERROR_NULL_USER";
case FIRAuthErrorCodeWebInternalError:
return @"ERROR_WEB_INTERNAL_ERROR";
}
@@ -981,6 +992,10 @@ static NSString *const FIRAuthErrorCodeString(FIRAuthErrorCode code) {
return nil;
}
++ (NSError *)nullUserErrorWithMessage:(nullable NSString *)message {
+ return [self errorWithCode:FIRAuthInternalErrorCodeNullUser message:message];
+}
+
+ (NSError *)keychainErrorWithFunction:(NSString *)keychainFunction status:(OSStatus)status {
NSString *failureReason = [NSString stringWithFormat:@"%@ (%li)", keychainFunction, (long)status];
return [self errorWithCode:FIRAuthInternalErrorCodeKeychainError userInfo:@{