firebase / firebase/functions-samples
[DOCS] for sample: auth-blocking-functions | Cannot extract event_type
- Dominant language
- JavaScript
- Stars
- 12.2k
- Forks
- 3.8k
- Avg merge
- 3d 23h
- Merged PRs (30d)
- 1
Description
### [auth-blocking-functions](https://github.com/firebase/functions-samples/tree/main/Python/quickstarts/auth-blocking-functions)
Given the Google Documentations here to [Getting user and context information](https://firebase.google.com/docs/auth/extend-with-blocking-functions?gen=2nd#getting_user_and_context_information), some fields are not available on the `AuthBlockingEvent` dataclass.
For example I can extract the following:
```python
from firebase_admin import initialize_app
from firebase_functions import https_fn, identity_fn, options
initialize_app()
@identity_fn.before_user_signed_in()
def handle_user(
event: identity_fn.AuthBlockingEvent,
) -> identity_fn.BeforeSignInResponse | None:
email = event.data.email
uid = event.data.uid
event_id = event.event_id
```
However, the following does on exist on the even signature.
```python
from firebase_admin import initialize_app
from firebase_functions import https_fn, identity_fn, options
initialize_app()
@identity_fn.before_user_signed_in()
def handle_user(
event: identity_fn.AuthBlockingEvent,
) -> identity_fn.BeforeSignInResponse | None:
event_type = event.event_type
auth_type = event.auth_type
resource = event.resource
# etc
```
Contributor guide
Assessment
This issue has not been assessed yet.