Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
FIRUser.m
  • Loading branch information
renkelvin committed Oct 1, 2019
commit cdc08daf23cade5ea0eec05d34c435f76dd7fcd4
31 changes: 31 additions & 0 deletions Firebase/Auth/Source/User/FIRUser.m
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
#import "FIREmailAuthProvider.h"
#import "FIREmailPasswordAuthCredential.h"
#import "FIREmailLinkSignInRequest.h"
#import "FIRFederatedAuthProvider.h"
#import "FIRGameCenterAuthCredential.h"
#import "FIRGetAccountInfoRequest.h"
#import "FIRGetAccountInfoResponse.h"
Expand Down Expand Up @@ -791,6 +792,21 @@ - (void)reauthenticateAndRetrieveDataWithCredential:(FIRAuthCredential *) creden
});
}

- (void)reauthenticateWithProvider:(id<FIRFederatedAuthProvider>)provider
UIDelegate:(nullable id<FIRAuthUIDelegate>)UIDelegate
completion:(nullable FIRAuthDataResultCallback)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 {
__block NSString *result;
dispatch_sync(FIRAuthGlobalWorkQueue(), ^{
Expand Down Expand Up @@ -1234,6 +1250,21 @@ - (void)linkAndRetrieveDataWithCredential:(FIRAuthCredential *)credential
});
}

- (void)linkWithProvider:(id<FIRFederatedAuthProvider>)provider
UIDelegate:(nullable id<FIRAuthUIDelegate>)UIDelegate
completion:(nullable FIRAuthDataResultCallback)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
completion:(nullable FIRAuthResultCallback)completion {
[_taskQueue enqueueTask:^(FIRAuthSerialTaskCompletionBlock _Nonnull complete) {
Expand Down