Skip to content

Commit 0ead4e7

Browse files
committed
Merge commit 'f60b4d522adaab193a9c052648e4b714f9e0631a' into bs-databaseinterop
* commit 'f60b4d522adaab193a9c052648e4b714f9e0631a': Use Interop for Auth token fetching Use macro to get auth component Change `getTokenForcingRefresh:withCallback:` call to use Interop component version of Auth Clean up imports
2 parents 1cd4e13 + f60b4d5 commit 0ead4e7

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

Firebase/Database/Login/FAuthTokenProvider.m

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,14 @@
1515
*/
1616

1717
#import "FAuthTokenProvider.h"
18-
#import "FUtilities.h"
18+
19+
#import <FirebaseAuthInterop/FIRAuthInterop.h>
1920
#import <FirebaseCore/FIRAppInternal.h>
21+
#import <FirebaseCore/FIRComponent.h>
22+
#import <FirebaseCore/FIRComponentContainer.h>
2023
#import <FirebaseCore/FIRLogger.h>
24+
25+
#import "FUtilities.h"
2126
#import "FIRDatabaseQuery_Private.h"
2227
#import "FIRNoopAuthTokenProvider.h"
2328

@@ -84,8 +89,8 @@ - (instancetype) initWithFirebaseApp:(FIRApp *)app {
8489
}
8590

8691
- (void) fetchTokenForcingRefresh:(BOOL)forceRefresh withCallback:(fbt_void_nsstring_nserror)callback {
87-
// TODO: Don't fetch token if there is no current user
88-
[self.app getTokenForcingRefresh:forceRefresh withCallback:^(NSString * _Nullable token, NSError * _Nullable error) {
92+
id<FIRAuthInterop> auth = FIR_COMPONENT(FIRAuthInterop, self.app.container);
93+
[auth getTokenForcingRefresh:forceRefresh withCallback:^(NSString * _Nullable token, NSError * _Nullable error) {
8994
dispatch_async([FIRDatabaseQuery sharedQueue], ^{
9095
callback(token, error);
9196
});

0 commit comments

Comments
 (0)