aboutsummaryrefslogtreecommitdiffhomepage
path: root/Firebase/Auth
diff options
context:
space:
mode:
authorGravatar Zsika Phillip <protocol86@users.noreply.github.com>2018-03-15 23:28:52 -0700
committerGravatar GitHub <noreply@github.com>2018-03-15 23:28:52 -0700
commit1395c8202b236188b9e4e1bfc2a3e00244179593 (patch)
tree9c7e4aeae4c95a6a3e412c214b04fe681a2fb6cf /Firebase/Auth
parent9060078609232082a989c7906e8d53b6c3b490b4 (diff)
Adds exception for invalid parameter (#931)
* Adds exception for invalid parameter * Account for differences between find and git output (#932)
Diffstat (limited to 'Firebase/Auth')
-rw-r--r--Firebase/Auth/Source/FIRAuth.m13
1 files changed, 13 insertions, 0 deletions
diff --git a/Firebase/Auth/Source/FIRAuth.m b/Firebase/Auth/Source/FIRAuth.m
index 387fab7..3b29238 100644
--- a/Firebase/Auth/Source/FIRAuth.m
+++ b/Firebase/Auth/Source/FIRAuth.m
@@ -104,6 +104,14 @@ static NSString *const kUserKey = @"%@_firebase_user";
static NSString *const kMissingEmailInvalidParameterExceptionReason =
@"The email used to initiate password reset cannot be nil.";
+/** @var kHandleCodeInAppFalseExceptionReason
+ @brief The reason for @c invalidParameterException when the handleCodeInApp parameter is false
+ on the ActionCodeSettings object used to send the link for Email-link Authentication.
+ */
+static NSString *const kHandleCodeInAppFalseExceptionReason =
+ @"You must set handleCodeInApp in your ActionCodeSettings to true for Email-link "
+ "Authentication.";
+
/** @var kPasswordResetRequestType
@brief The action code type value for resetting password in the check action code response.
*/
@@ -1108,6 +1116,11 @@ static NSMutableDictionary *gKeychainServiceNameForAppName;
[FIRAuthExceptionUtils raiseInvalidParameterExceptionWithReason:
kMissingEmailInvalidParameterExceptionReason];
}
+
+ if (!actionCodeSettings.handleCodeInApp) {
+ [FIRAuthExceptionUtils raiseInvalidParameterExceptionWithReason:
+ kHandleCodeInAppFalseExceptionReason];
+ }
FIRGetOOBConfirmationCodeRequest *request =
[FIRGetOOBConfirmationCodeRequest signInWithEmailLinkRequest:email
actionCodeSettings:actionCodeSettings