-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
[REQUIRED] Environment info
firebase-tools: 11.0.1
Platform: Manjaro Linux
[REQUIRED] Test case
export const beforeSignIn = auth.user().beforeSignIn((user, context) => { });
[REQUIRED] Steps to reproduce
- Create a firebase blocking function 'beforeSignIn', do not create a function 'beforeCreate'
- Try to start local emulator for functions and auth
- Observe errors
`
✔ functions[us-central1-beforeSignIn]: providers/cloud.auth/eventTypes/user.beforeSignIn function initialized (http://localhost:5001/incubator-5dol/us-central1/beforeSignIn).
⚠ Error updating blocking functions config to the auth emulator: FirebaseError: HTTP Error: 400, INVALID_BLOCKING_FUNCTION: ((Expected an absolute URI with valid scheme and host.))
`
5. Now additionally add 'beforeCreate'
6. Observe emulators starting successfully
7. A had a quick glance at the source code and it looks like blocking functions config by default is initialized to ''. When only one function is present still both functions are being registered and don't pass validation. Maybe registering only those that are initialized should fix the issue.
[REQUIRED] Expected behavior
Emulators should start successfully even if only one of two blocking functions is present
[REQUIRED] Actual behavior
`
✔ functions[us-central1-beforeSignIn]: providers/cloud.auth/eventTypes/user.beforeSignIn function initialized (http://localhost:5001/incubator-5dol/us-central1/beforeSignIn).
⚠ Error updating blocking functions config to the auth emulator: FirebaseError: HTTP Error: 400, INVALID_BLOCKING_FUNCTION: ((Expected an absolute URI with valid scheme and host.))
`