firebase / firebase/firebase-js-sdk
TypeScript Error: Property 'reloadUserInfo' does not exist on type 'User'.
- Dominant language
- TypeScript
- Stars
- 5.1k
- Forks
- 1k
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 37
Description
### Operating System
Ubuntu 22.04.3 LTS
### Browser Version
Chrome/117.0.5938.92 (Official Build) (64-bit)
### Firebase SDK Version
10.3.0
### Firebase SDK Product:
Auth
### Describe your project's tooling
Nuxt 3 application with Vite and Vue 3.
### Describe the problem
Property `reloadUserInfo` is not defined in the type definition of [`User`](https://github.com/firebase/firebase-js-sdk/blob/master/packages/auth-types/index.d.ts#L21) but `is accessible via the user object` retrieved from the `getAuth().currentUser` utility in the auth module.
Property Property `reloadUserInfo` should be added to the type definition of [`User`](https://github.com/firebase/firebase-js-sdk/blob/master/packages/auth-types/index.d.ts#L21), to resolve the TypeScript error faced when using that in the source code.

I want to use one of the properties from this object for my application's authentication use case which is otherwise unavailable directly in the `User` instance. (Have referred https://github.com/firebase/firebase-js-sdk/issues/6364, as well)
### Steps and code to reproduce issue
**Source Code:**
```
async fetchUser(): Promise < User | null > {
try {
const user = (await getAuth()).currentUser;
console.log(user?.reloadUserInfo);
return user;
} catch (error) {
console.log(error);
}
}
fetchUser().then((user) => {
console.log(user);
});
```
**Output:**
When I console logged the output of the `user.reloadUserInfo`, it got an object with the following keys:

Contributor guide
Assessment
This issue has not been assessed yet.