Skip to content

Commit

Permalink
Restricted to iOS only
Browse files Browse the repository at this point in the history
  • Loading branch information
renkelvin committed Aug 19, 2019
1 parent 3a84c20 commit 7d03916
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 13 deletions.
2 changes: 1 addition & 1 deletion Firebase/Auth/Source/Public/FIRUser.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@

#import "FIRAuth.h"
#import "FIRAuthDataResult.h"
#import "FIRAuthUIDelegate.h"
#import "FIRUserInfo.h"

@class FIRAuthTokenResult;
@class FIRPhoneAuthCredential;
@class FIRUserProfileChangeRequest;
@class FIRUserMetadata;
@protocol FIRAuthUIDelegate;

NS_ASSUME_NONNULL_BEGIN

Expand Down
32 changes: 20 additions & 12 deletions Firebase/Auth/Source/User/FIRUser.m
Original file line number Diff line number Diff line change
Expand Up @@ -795,12 +795,16 @@ - (void)reauthenticateAndRetrieveDataWithCredential:(FIRAuthCredential *) creden
- (void)reauthenticateWithProvider:(id<FIRFederatedAuthProvider>)provider
UIDelegate:(nullable id<FIRAuthUIDelegate>)UIDelegate
completion:(nullable FIRAuthDataResultCallback)completion {
[provider getCredentialWithUIDelegate:UIDelegate
completion:^(FIRAuthCredential *_Nullable credential,
NSError *_Nullable error) {
[self reauthenticateWithCredential:credential
completion:completion];
}];
#if TARGET_OS_IOS
dispatch_async(FIRAuthGlobalWorkQueue(), ^{
[provider getCredentialWithUIDelegate:UIDelegate
completion:^(FIRAuthCredential *_Nullable credential,
NSError *_Nullable error) {
[self reauthenticateWithCredential:credential
completion:completion];
}];
});
#endif // TARGET_OS_IOS
}

- (nullable NSString *)refreshToken {
Expand Down Expand Up @@ -1249,12 +1253,16 @@ - (void)linkAndRetrieveDataWithCredential:(FIRAuthCredential *)credential
- (void)linkWithProvider:(id<FIRFederatedAuthProvider>)provider
UIDelegate:(nullable id<FIRAuthUIDelegate>)UIDelegate
completion:(nullable FIRAuthDataResultCallback)completion {
[provider getCredentialWithUIDelegate:UIDelegate
completion:^(FIRAuthCredential *_Nullable credential,
NSError *_Nullable error) {
[self linkWithCredential:credential
completion:completion];
}];
#if TARGET_OS_IOS
dispatch_async(FIRAuthGlobalWorkQueue(), ^{
[provider getCredentialWithUIDelegate:UIDelegate
completion:^(FIRAuthCredential *_Nullable credential,
NSError *_Nullable error) {
[self linkWithCredential:credential
completion:completion];
}];
});
#endif // TARGET_OS_IOS
}

- (void)unlinkFromProvider:(NSString *)provider
Expand Down

0 comments on commit 7d03916

Please sign in to comment.