You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Inspect the type Problem (or the context.auth) in the code above.
The auth object is typed as:
auth?: {
token: object;
uid: string;};
Where the token key is just typed as object without any further details.
I'm assuming but I didn't check that the same is true for similar database triggers.
[REQUIRED] Expected behavior
Expected to have typing similar to DecodedIdToken or ParsedToken as described in the reference:
The EventContext.auth reference page says to see the security rules reference, linking to the Cloud Firestore Rules reference page, as does the typescript definition file itself. I'm assuming it should actually link to the Database Rules reference page, especially since the reference and the typescript definition file about EventContext.auth say that "This field is only populated for Realtime Database triggers and Callable functions.". The reference about the Database Rules explains with detail what the keys of the token object are, which is why I was expecting that this would be reflected in the typing as well.
[REQUIRED] Actual behavior
Inspection of the type learns that it is just typed as object.
Were you able to successfully deploy your functions?
Yes, this is about typescript typing, so it doesn't impede deployment because it can be easily coerced to be of a specific type, just lowers type safety.
The text was updated successfully, but these errors were encountered:
Related issues
#822
[REQUIRED] Version info
node: 18.12.1 although not relevant here
firebase-functions: 4.4.0
firebase-tools: 12.0.0
firebase-admin: 11.8.0
[REQUIRED] Test case
[REQUIRED] Steps to reproduce
Inspect the type
Problem
(or thecontext.auth
) in the code above.The
auth
object is typed as:Where the
token
key is just typed asobject
without any further details.I'm assuming but I didn't check that the same is true for similar database triggers.
[REQUIRED] Expected behavior
Expected to have typing similar to
DecodedIdToken
orParsedToken
as described in the reference:The
EventContext.auth
reference page says to see the security rules reference, linking to the Cloud Firestore Rules reference page, as does the typescript definition file itself. I'm assuming it should actually link to the Database Rules reference page, especially since the reference and the typescript definition file aboutEventContext.auth
say that "This field is only populated for Realtime Database triggers and Callable functions.". The reference about the Database Rules explains with detail what the keys of thetoken
object are, which is why I was expecting that this would be reflected in the typing as well.[REQUIRED] Actual behavior
Inspection of the type learns that it is just typed as
object
.Were you able to successfully deploy your functions?
Yes, this is about typescript typing, so it doesn't impede deployment because it can be easily coerced to be of a specific type, just lowers type safety.
The text was updated successfully, but these errors were encountered: