File tree Expand file tree Collapse file tree 4 files changed +17
-0
lines changed
android/src/main/java/io/invertase/firebase/auth Expand file tree Collapse file tree 4 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -1970,6 +1970,7 @@ private WritableMap firebaseUserToMap(FirebaseUser user) {
1970
1970
final String provider = user .getProviderId ();
1971
1971
final boolean verified = user .isEmailVerified ();
1972
1972
final String phoneNumber = user .getPhoneNumber ();
1973
+ final String tenantId = user .getTenantId ();
1973
1974
1974
1975
userMap .putString ("uid" , uid );
1975
1976
userMap .putString ("providerId" , provider );
@@ -2000,6 +2001,12 @@ private WritableMap firebaseUserToMap(FirebaseUser user) {
2000
2001
userMap .putNull ("phoneNumber" );
2001
2002
}
2002
2003
2004
+ if (tenantId != null && !"" .equals (tenantId )) {
2005
+ userMap .putString ("tenantId" , tenantId );
2006
+ } else {
2007
+ userMap .putNull ("tenantId" );
2008
+ }
2009
+
2003
2010
userMap .putArray ("providerData" , convertProviderData (user .getProviderData (), user ));
2004
2011
2005
2012
WritableMap metadataMap = Arguments .createMap ();
Original file line number Diff line number Diff line change @@ -1210,6 +1210,7 @@ - (NSDictionary *)firebaseUserToDict:(FIRUser *)user {
1210
1210
@" providerData" : [self convertProviderData: user.providerData],
1211
1211
keyProviderId: [user.providerID lowercaseString ],
1212
1212
@" refreshToken" : user.refreshToken ,
1213
+ @" tenantId" : user.tenantID ? (id ) user.tenantID : [NSNull null ],
1213
1214
keyUid: user.uid
1214
1215
};
1215
1216
}
Original file line number Diff line number Diff line change @@ -52,6 +52,10 @@ export default class User {
52
52
return this . _user . phoneNumber || null ;
53
53
}
54
54
55
+ get tenantId ( ) {
56
+ return this . _user . tenantId || null ;
57
+ }
58
+
55
59
get photoURL ( ) {
56
60
return this . _user . photoURL || null ;
57
61
}
Original file line number Diff line number Diff line change @@ -397,6 +397,10 @@ export namespace FirebaseAuthTypes {
397
397
* Returns the unique identifier of the provider type that this instance corresponds to.
398
398
*/
399
399
providerId : string ;
400
+ /**
401
+ * Returns a string representing the multi-tenant tenant id. This is null if the user is not associated with a tenant.
402
+ */
403
+ tenantId ?: string ;
400
404
/**
401
405
* Returns a user identifier as specified by the authentication provider.
402
406
*/
@@ -1247,6 +1251,7 @@ export namespace FirebaseAuthTypes {
1247
1251
* await firebase.auth().setTenantId('tenant-123');
1248
1252
* ```
1249
1253
*
1254
+ * @error auth/invalid-tenant-id if the tenant id is invalid for some reason
1250
1255
* @param tenantId the tenantID current app bind to.
1251
1256
*/
1252
1257
setTenantId ( tenantId : string ) : Promise < void > ;
You can’t perform that action at this time.
0 commit comments