firebase / firebase/firebase-tools
Context passed to emulated auth.onCreate is not a valid EventContext
- Dominant language
- TypeScript
- Stars
- 4.5k
- Forks
- 1.3k
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 84
Description
### [REQUIRED] Environment info
**firebase-tools:8.14.1**
**Platform:macOS**
### [REQUIRED] Test case
```
functions
.auth.user()
.onCreate(userRecord, context) => {
console.log(context)
}
```
### [REQUIRED] Steps to reproduce
Include the above snippet as a cloud function and create a new user. You'll see that the `context` is not a valid `EventContext`.
### [REQUIRED] Expected behavior
I would expect `context` to contain all properties specified in `EventContext`.
### [REQUIRED] Actual behavior
`context` is missing e.g. the `eventId` and the `timestamp`. See the log output:
```
{
eventType: 'google.firebase.auth.user.create',
resource: { service: 'firebaseauth.googleapis.com', name: undefined },
params: {}
}
```
Contributor guide
Assessment
This issue has not been assessed yet.