Skip to content

Commit d4bda5b

Browse files
committed
Fix tenantId field when setting user via updateCurrentUser
1 parent e2c4ab2 commit d4bda5b

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

packages/auth/src/core/user/user_impl.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,8 @@ describe('core/user/user_impl', () => {
263263
phoneNumber: 'number',
264264
photoURL: 'photo',
265265
emailVerified: false,
266-
isAnonymous: true
266+
isAnonymous: true,
267+
tenantId: 'tenant-id'
267268
});
268269

269270
const newAuth = await testAuth();
@@ -272,6 +273,7 @@ describe('core/user/user_impl', () => {
272273
expect(copy.stsTokenManager).not.to.eq(user.stsTokenManager);
273274
expect(copy.toJSON()).to.eql(user.toJSON());
274275
expect(copy.auth).to.eq(newAuth);
276+
expect(copy.tenantId).to.eq('tenant-id');
275277
});
276278
});
277279
});

packages/auth/src/core/user/user_impl.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ export class UserImpl implements UserInternal {
8787
this.phoneNumber = opt.phoneNumber || null;
8888
this.photoURL = opt.photoURL || null;
8989
this.isAnonymous = opt.isAnonymous || false;
90+
this.tenantId = opt.tenantId || null;
9091
this.metadata = new UserMetadata(
9192
opt.createdAt || undefined,
9293
opt.lastLoginAt || undefined

0 commit comments

Comments
 (0)