I'm currently working with a cloud function that takes an email as input and then returns the user information, which includes the uid.
The declaration of the function looks like this:
const getUserByEmail = httpsCallable(functions, 'getUserByEmail')
const user = await getUserByEmail({
email: email,
})
However, when I attempt to access "user.data.id," TypeScript gives me an error message stating:
"Object is of type 'unknown'.ts(2571) (property)
HttpsCallableResult.data: unknown Data returned from callable function.
I am unsure of what I may be overlooking in this situation. Any insights or suggestions would be greatly appreciated.
Edit: I did try using "user: any" and TypeScript accepted it, but I know it's not the best solution.