From 87be16db5a5a1fe4a981cb09e31bd3f989b2590b Mon Sep 17 00:00:00 2001 From: Rexios Date: Tue, 18 Jan 2022 11:22:53 -0500 Subject: [PATCH] TenantId can be reset to null after being set to something else --- .../plugins/firebase/auth/FlutterFirebaseAuthPlugin.java | 4 +--- .../firebase_auth/ios/Classes/FLTFirebaseAuthPlugin.m | 4 +++- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/firebase_auth/firebase_auth/android/src/main/java/io/flutter/plugins/firebase/auth/FlutterFirebaseAuthPlugin.java b/packages/firebase_auth/firebase_auth/android/src/main/java/io/flutter/plugins/firebase/auth/FlutterFirebaseAuthPlugin.java index eea97d2af8d3..6f76ab06ae08 100755 --- a/packages/firebase_auth/firebase_auth/android/src/main/java/io/flutter/plugins/firebase/auth/FlutterFirebaseAuthPlugin.java +++ b/packages/firebase_auth/firebase_auth/android/src/main/java/io/flutter/plugins/firebase/auth/FlutterFirebaseAuthPlugin.java @@ -145,9 +145,7 @@ static FirebaseAuth getAuth(Map arguments) { FirebaseApp app = FirebaseApp.getInstance(appName); FirebaseAuth auth = FirebaseAuth.getInstance(app); String tenantId = (String) arguments.get(Constants.TENANT_ID); - if (tenantId != null) { - auth.setTenantId(tenantId); - } + auth.setTenantId(tenantId); return auth; } diff --git a/packages/firebase_auth/firebase_auth/ios/Classes/FLTFirebaseAuthPlugin.m b/packages/firebase_auth/firebase_auth/ios/Classes/FLTFirebaseAuthPlugin.m index b777494fb2b5..24b95de349c6 100644 --- a/packages/firebase_auth/firebase_auth/ios/Classes/FLTFirebaseAuthPlugin.m +++ b/packages/firebase_auth/firebase_auth/ios/Classes/FLTFirebaseAuthPlugin.m @@ -1054,7 +1054,9 @@ - (FIRAuth *_Nullable)getFIRAuthFromArguments:(NSDictionary *)arguments { FIRApp *app = [FLTFirebasePlugin firebaseAppNamed:appNameDart]; FIRAuth *auth = [FIRAuth authWithApp:app]; - if (tenantId != nil && ![tenantId isEqual:[NSNull null]]) { + if ([tenantId isEqual:[NSNull null]]) { + auth.tenantID = nil; + } else { auth.tenantID = tenantId; }