Skip to content

Commit 86556a3

Browse files
committed
Use metadata._copy instead of manually setting metadata
1 parent 5154ed6 commit 86556a3

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,13 +140,15 @@ export class UserImpl implements UserInternal {
140140
}
141141

142142
_clone(auth: AuthInternal): UserInternal {
143-
return new UserImpl({
143+
const newUser = new UserImpl({
144144
...this,
145-
createdAt: this.metadata.creationTime,
146-
lastLoginAt: this.metadata.lastSignInTime,
147145
auth,
148146
stsTokenManager: this.stsTokenManager._clone()
149-
});
147+
})
148+
149+
newUser.metadata._copy(this.metadata)
150+
151+
return newUser;
150152
}
151153

152154
_onReload(callback: NextFn<APIUserInfo>): void {

0 commit comments

Comments
 (0)