aboutsummaryrefslogtreecommitdiffhomepage
path: root/Firebase/Auth
diff options
context:
space:
mode:
Diffstat (limited to 'Firebase/Auth')
-rw-r--r--Firebase/Auth/Source/FIRAuth.m54
-rw-r--r--Firebase/Auth/Source/FIRAuthAPNSTokenManager.m2
-rw-r--r--Firebase/Auth/Source/RPCs/FIRCreateAuthURIResponse.m2
-rw-r--r--Firebase/Auth/Source/RPCs/FIRDeleteAccountResponse.m2
-rw-r--r--Firebase/Auth/Source/RPCs/FIRGetOOBConfirmationCodeResponse.m2
-rw-r--r--Firebase/Auth/Source/RPCs/FIRResetPasswordResponse.m2
-rw-r--r--Firebase/Auth/Source/RPCs/FIRSetAccountInfoResponse.m2
-rw-r--r--Firebase/Auth/Source/RPCs/FIRSignUpNewUserResponse.m2
-rw-r--r--Firebase/Auth/Source/RPCs/FIRVerifyAssertionResponse.m2
-rw-r--r--Firebase/Auth/Source/RPCs/FIRVerifyCustomTokenResponse.m2
-rw-r--r--Firebase/Auth/Source/RPCs/FIRVerifyPasswordResponse.m2
11 files changed, 26 insertions, 48 deletions
diff --git a/Firebase/Auth/Source/FIRAuth.m b/Firebase/Auth/Source/FIRAuth.m
index ad363e0..ebca6c8 100644
--- a/Firebase/Auth/Source/FIRAuth.m
+++ b/Firebase/Auth/Source/FIRAuth.m
@@ -657,12 +657,29 @@ static NSMutableDictionary *gKeychainServiceNameForAppName;
isReauthentication ? FIRAuthOperationTypeReauth : FIRAuthOperationTypeSignUpOrSignIn;
[self signInWithPhoneCredential:phoneCredential
operation:operation
- callback:^(FIRUser *_Nullable user,
+ callback:^(FIRVerifyPhoneNumberResponse *_Nullable response,
NSError *_Nullable error) {
if (callback) {
- FIRAuthDataResult *result = user ?
- [[FIRAuthDataResult alloc] initWithUser:user additionalUserInfo:nil] : nil;
- callback(result, error);
+ if (error) {
+ callback(nil, error);
+ return;
+ }
+
+ [self completeSignInWithAccessToken:response.IDToken
+ accessTokenExpirationDate:response.approximateExpirationDate
+ refreshToken:response.refreshToken
+ anonymous:NO
+ callback:^(FIRUser *_Nullable user, NSError *_Nullable error) {
+ FIRAdditionalUserInfo *additionalUserInfo =
+ [[FIRAdditionalUserInfo alloc] initWithProviderID:FIRPhoneAuthProviderID
+ profile:nil
+ username:nil
+ isNewUser:response.isNewUser];
+ FIRAuthDataResult *result = user ?
+ [[FIRAuthDataResult alloc] initWithUser:user
+ additionalUserInfo:additionalUserInfo] : nil;
+ callback(result, error);
+ }];
}
}];
return;
@@ -1143,14 +1160,14 @@ static NSMutableDictionary *gKeychainServiceNameForAppName;
*/
- (void)signInWithPhoneCredential:(FIRPhoneAuthCredential *)credential
operation:(FIRAuthOperationType)operation
- callback:(FIRAuthResultCallback)callback {
+ callback:(FIRVerifyPhoneNumberResponseCallback)callback {
if (credential.temporaryProof.length && credential.phoneNumber.length) {
FIRVerifyPhoneNumberRequest *request =
[[FIRVerifyPhoneNumberRequest alloc] initWithTemporaryProof:credential.temporaryProof
phoneNumber:credential.phoneNumber
operation:operation
requestConfiguration:_requestConfiguration];
- [self phoneNumberSignInWithRequest:request callback:callback];
+ [FIRAuthBackend verifyPhoneNumber:request callback:callback];
return;
}
@@ -1167,32 +1184,9 @@ static NSMutableDictionary *gKeychainServiceNameForAppName;
verificationCode:credential.verificationCode
operation:operation
requestConfiguration:_requestConfiguration];
- [self phoneNumberSignInWithRequest:request callback:callback];
+ [FIRAuthBackend verifyPhoneNumber:request callback:callback];
}
-
-/** @fn phoneNumberSignInWithVerificationID:pasverificationCodesword:callback:
- @brief Signs in using a FIRVerifyPhoneNumberRequest object.
- @param request THe FIRVerifyPhoneNumberRequest request object.
- @param callback A block which is invoked when the sign in finishes (or is cancelled.) Invoked
- asynchronously on the global auth work queue in the future.
- */
-- (void)phoneNumberSignInWithRequest:(FIRVerifyPhoneNumberRequest *)request
- callback:(FIRAuthResultCallback)callback {
- [FIRAuthBackend verifyPhoneNumber:request
- callback:^(FIRVerifyPhoneNumberResponse *_Nullable response,
- NSError *_Nullable error) {
- if (error) {
- callback(nil, error);
- return;
- }
- [self completeSignInWithAccessToken:response.IDToken
- accessTokenExpirationDate:response.approximateExpirationDate
- refreshToken:response.refreshToken
- anonymous:NO
- callback:callback];
- }];
-}
#endif
/** @fn internalSignInAndRetrieveDataWithCustomToken:completion:
diff --git a/Firebase/Auth/Source/FIRAuthAPNSTokenManager.m b/Firebase/Auth/Source/FIRAuthAPNSTokenManager.m
index 7775305..215a391 100644
--- a/Firebase/Auth/Source/FIRAuthAPNSTokenManager.m
+++ b/Firebase/Auth/Source/FIRAuthAPNSTokenManager.m
@@ -73,7 +73,9 @@ static const NSTimeInterval kLegacyRegistrationTimeout = 30;
} else {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+#if TARGET_OS_IOS
[_application registerForRemoteNotificationTypes:UIRemoteNotificationTypeAlert];
+#endif // TARGET_OS_IOS
#pragma clang diagnostic pop
}
});
diff --git a/Firebase/Auth/Source/RPCs/FIRCreateAuthURIResponse.m b/Firebase/Auth/Source/RPCs/FIRCreateAuthURIResponse.m
index c6b9d03..12ef97c 100644
--- a/Firebase/Auth/Source/RPCs/FIRCreateAuthURIResponse.m
+++ b/Firebase/Auth/Source/RPCs/FIRCreateAuthURIResponse.m
@@ -16,8 +16,6 @@
#import "FIRCreateAuthURIResponse.h"
-#import "FIRAuthErrorUtils.h"
-
@implementation FIRCreateAuthURIResponse
- (BOOL)setWithDictionary:(NSDictionary *)dictionary
diff --git a/Firebase/Auth/Source/RPCs/FIRDeleteAccountResponse.m b/Firebase/Auth/Source/RPCs/FIRDeleteAccountResponse.m
index 671a41f..ae98175 100644
--- a/Firebase/Auth/Source/RPCs/FIRDeleteAccountResponse.m
+++ b/Firebase/Auth/Source/RPCs/FIRDeleteAccountResponse.m
@@ -16,8 +16,6 @@
#import "FIRDeleteAccountResponse.h"
-#import "FIRAuthErrorUtils.h"
-
@implementation FIRDeleteAccountResponse
- (BOOL)setWithDictionary:(NSDictionary *)dictionary
diff --git a/Firebase/Auth/Source/RPCs/FIRGetOOBConfirmationCodeResponse.m b/Firebase/Auth/Source/RPCs/FIRGetOOBConfirmationCodeResponse.m
index bd028f1..0b6c416 100644
--- a/Firebase/Auth/Source/RPCs/FIRGetOOBConfirmationCodeResponse.m
+++ b/Firebase/Auth/Source/RPCs/FIRGetOOBConfirmationCodeResponse.m
@@ -16,8 +16,6 @@
#import "FIRGetOOBConfirmationCodeResponse.h"
-#import "FIRAuthErrorUtils.h"
-
NS_ASSUME_NONNULL_BEGIN
/** @var kOOBCodeKey
diff --git a/Firebase/Auth/Source/RPCs/FIRResetPasswordResponse.m b/Firebase/Auth/Source/RPCs/FIRResetPasswordResponse.m
index 9a1556b..6092cfe 100644
--- a/Firebase/Auth/Source/RPCs/FIRResetPasswordResponse.m
+++ b/Firebase/Auth/Source/RPCs/FIRResetPasswordResponse.m
@@ -16,8 +16,6 @@
#import "FIRResetPasswordResponse.h"
-#import "FIRAuthErrorUtils.h"
-
@implementation FIRResetPasswordResponse
- (BOOL)setWithDictionary:(NSDictionary *)dictionary
diff --git a/Firebase/Auth/Source/RPCs/FIRSetAccountInfoResponse.m b/Firebase/Auth/Source/RPCs/FIRSetAccountInfoResponse.m
index 6e228eb..ff9c7a6 100644
--- a/Firebase/Auth/Source/RPCs/FIRSetAccountInfoResponse.m
+++ b/Firebase/Auth/Source/RPCs/FIRSetAccountInfoResponse.m
@@ -16,8 +16,6 @@
#import "FIRSetAccountInfoResponse.h"
-#import "FIRAuthErrorUtils.h"
-
@implementation FIRSetAccountInfoResponseProviderUserInfo
- (instancetype)initWithDictionary:(NSDictionary *)dictionary {
diff --git a/Firebase/Auth/Source/RPCs/FIRSignUpNewUserResponse.m b/Firebase/Auth/Source/RPCs/FIRSignUpNewUserResponse.m
index 7e58c5d..2071e07 100644
--- a/Firebase/Auth/Source/RPCs/FIRSignUpNewUserResponse.m
+++ b/Firebase/Auth/Source/RPCs/FIRSignUpNewUserResponse.m
@@ -16,8 +16,6 @@
#import "FIRSignUpNewUserResponse.h"
-#import "FIRAuthErrorUtils.h"
-
@implementation FIRSignUpNewUserResponse
- (BOOL)setWithDictionary:(NSDictionary *)dictionary
diff --git a/Firebase/Auth/Source/RPCs/FIRVerifyAssertionResponse.m b/Firebase/Auth/Source/RPCs/FIRVerifyAssertionResponse.m
index 8c970c8..5ee39fa 100644
--- a/Firebase/Auth/Source/RPCs/FIRVerifyAssertionResponse.m
+++ b/Firebase/Auth/Source/RPCs/FIRVerifyAssertionResponse.m
@@ -16,8 +16,6 @@
#import "FIRVerifyAssertionResponse.h"
-#import "FIRAuthErrorUtils.h"
-
@implementation FIRVerifyAssertionResponse
- (BOOL)setWithDictionary:(NSDictionary *)dictionary
diff --git a/Firebase/Auth/Source/RPCs/FIRVerifyCustomTokenResponse.m b/Firebase/Auth/Source/RPCs/FIRVerifyCustomTokenResponse.m
index 8a87141..b6c3818 100644
--- a/Firebase/Auth/Source/RPCs/FIRVerifyCustomTokenResponse.m
+++ b/Firebase/Auth/Source/RPCs/FIRVerifyCustomTokenResponse.m
@@ -16,8 +16,6 @@
#import "FIRVerifyCustomTokenResponse.h"
-#import "FIRAuthErrorUtils.h"
-
@implementation FIRVerifyCustomTokenResponse
- (BOOL)setWithDictionary:(NSDictionary *)dictionary
diff --git a/Firebase/Auth/Source/RPCs/FIRVerifyPasswordResponse.m b/Firebase/Auth/Source/RPCs/FIRVerifyPasswordResponse.m
index d2c4a7c..71b4edd 100644
--- a/Firebase/Auth/Source/RPCs/FIRVerifyPasswordResponse.m
+++ b/Firebase/Auth/Source/RPCs/FIRVerifyPasswordResponse.m
@@ -16,8 +16,6 @@
#import "FIRVerifyPasswordResponse.h"
-#import "FIRAuthErrorUtils.h"
-
@implementation FIRVerifyPasswordResponse
- (BOOL)setWithDictionary:(NSDictionary *)dictionary