Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Firebase/Auth/Source/FIRAuthErrorUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,13 @@ NS_ASSUME_NONNULL_BEGIN
*/
+ (NSError *)nullUserErrorWithMessage:(nullable NSString *)message;

/** @fn invalidProviderIDErrorWithMessage:
@brief Constructs an @c NSError with the @c FIRAuthErrorCodeInvalidProviderID code.
@param message Error message from the backend, if any.
@remarks This error indicates that the provider id given for the web operation is invalid.
*/
+ (NSError *)invalidProviderIDErrorWithMessage:(nullable NSString *)message;

/** @fn invalidDynamicLinkDomainErrorWithMessage:
@brief Constructs an @c NSError with the code and message provided.
@param message Error message from the backend, if any.
Expand Down
14 changes: 14 additions & 0 deletions Firebase/Auth/Source/FIRAuthErrorUtils.m
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,12 @@
static NSString *const kFIRAuthErrorMessageNullUser = @"A null user object was provided as the "
"argument for an operation which requires a non-null user object.";

/** @var kFIRAuthErrorMessageInvalidProviderID
@brief Message for @c FIRAuthErrorCodeInvalidProviderID error code.
*/
static NSString *const kFIRAuthErrorMessageInvalidProviderID = @"The provider ID provided for the "
"attempted web operation is invalid.";

/** @var kFIRAuthErrorMessageInvalidDynamicLinkDomain
@brief Message for @c kFIRAuthErrorMessageInvalidDynamicLinkDomain error code.
*/
Expand Down Expand Up @@ -559,6 +565,8 @@
return kFIRAuthErrorMessageWebRequestFailed;
case FIRAuthErrorCodeNullUser:
return kFIRAuthErrorMessageNullUser;
case FIRAuthErrorCodeInvalidProviderID:
return kFIRAuthErrorMessageInvalidProviderID;
case FIRAuthErrorCodeInvalidDynamicLinkDomain:
return kFIRAuthErrorMessageInvalidDynamicLinkDomain;
case FIRAuthErrorCodeWebInternalError:
Expand Down Expand Up @@ -690,6 +698,8 @@
return @"ERROR_WEB_NETWORK_REQUEST_FAILED";
case FIRAuthErrorCodeNullUser:
return @"ERROR_NULL_USER";
case FIRAuthErrorCodeInvalidProviderID:
return @"ERROR_INVALID_PROVIDER_ID";
case FIRAuthErrorCodeInvalidDynamicLinkDomain:
return @"ERROR_INVALID_DYNAMIC_LINK_DOMAIN";
case FIRAuthErrorCodeWebInternalError:
Expand Down Expand Up @@ -1136,6 +1146,10 @@ + (NSError *)nullUserErrorWithMessage:(nullable NSString *)message {
return [self errorWithCode:FIRAuthInternalErrorCodeNullUser message:message];
}

+ (NSError *)invalidProviderIDErrorWithMessage:(nullable NSString *)message {
return [self errorWithCode:FIRAuthInternalErrorCodeInvalidProviderID message:message];
}

+ (NSError *)invalidDynamicLinkDomainErrorWithMessage:(nullable NSString *)message {
return [self errorWithCode:FIRAuthInternalErrorCodeInvalidDynamicLinkDomain message:message];
}
Expand Down
5 changes: 5 additions & 0 deletions Firebase/Auth/Source/FIRAuthInternalErrors.h
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,11 @@ typedef NS_ENUM(NSInteger, FIRAuthInternalErrorCode) {
FIRAuthInternalErrorCodeNullUser =
FIRAuthPublicErrorCodeFlag | FIRAuthErrorCodeNullUser,

/** Indicates that the provider id given for the web operation is invalid.
*/
FIRAuthInternalErrorCodeInvalidProviderID =
FIRAuthPublicErrorCodeFlag | FIRAuthErrorCodeInvalidProviderID,

/** Indicates that the Firebase Dynamic Link domain used is either not configured or is unauthorized
for the current project.
*/
Expand Down
5 changes: 5 additions & 0 deletions Firebase/Auth/Source/Public/FIRAuthErrors.h
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,11 @@ typedef NS_ENUM(NSInteger, FIRAuthErrorCode) {
*/
FIRAuthErrorCodeNullUser = 17067,

/**
* Represents the error code for when the given provider id for a web operation is invalid.
*/
FIRAuthErrorCodeInvalidProviderID = 17071,

/** Indicates that the Firebase Dynamic Link domain used is either not configured or is unauthorized
for the current project.
*/
Expand Down
14 changes: 12 additions & 2 deletions Firebase/Auth/Source/RPCs/FIRAuthBackend.m
Original file line number Diff line number Diff line change
Expand Up @@ -294,9 +294,15 @@
*/
static NSString *const kUnauthorizedDomainErrorMessage = @"UNAUTHORIZED_DOMAIN";

/** @var kInvalidProviderIDErrorMessage
@brief This is the error message the server will respond with if the provider id given for the
web operation is invalid.
*/
static NSString *const kInvalidProviderIDErrorMessage = @"INVALID_PROVIDER_ID";

/** @var kInvalidDynamicLinkDomainErrorMessage
@brief This is the error message the server will respond with if the dynamic link domain provided
in the request is invalid.
@brief This is the error message the server will respond with if the dynamic link domain
provided in the request is invalid.
*/
static NSString *const kInvalidDynamicLinkDomainErrorMessage = @"INVALID_DYNAMIC_LINK_DOMAIN";

Expand Down Expand Up @@ -1119,6 +1125,10 @@ + (nullable NSError *)clientErrorWithServerErrorMessage:(NSString *)serverErrorM
return [FIRAuthErrorUtils invalidContinueURIErrorWithMessage:serverDetailErrorMessage];
}

if ([shortErrorMessage isEqualToString:kInvalidProviderIDErrorMessage]) {
return [FIRAuthErrorUtils invalidProviderIDErrorWithMessage:serverDetailErrorMessage];
}

if ([shortErrorMessage isEqualToString:kInvalidDynamicLinkDomainErrorMessage]) {
return [FIRAuthErrorUtils invalidDynamicLinkDomainErrorWithMessage:serverDetailErrorMessage];
}
Expand Down