-
Notifications
You must be signed in to change notification settings - Fork 211
Auth onCreate and onDelete triggers for v2 functions #1383
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I found a few problems with this issue:
|
Hey @laurentpayot, thanks for requesting! This is currently a limitation of all 2nd gen functions (Node or Python). A workaround for now is to use 1st gen functions for Auth |
Thanks for your answer @jhuleatt. I did not know a mix of 1st and 2nd gen functions was possible. I will use this "workaround" for now. I’m still eagerly awaiting v2 auth triggers 😉 |
Any updates on this? |
Seems to be the only ones missing now, do we have an ETA on when these will make it into v2? |
+1 |
7 similar comments
+1 |
+1 |
+1 |
+1 |
+1 |
+1 |
+1 |
When can we expect this?` |
+1 |
I believe we can use a HTTP v2 function for blocking "Before the user is created" https://firebase.google.com/docs/auth/extend-with-blocking-functions?gen=2nd. |
+1 |
@cuong0993 > I believe we can use a HTTP v2 function for blocking "Before the user is created" https://firebase.google.com/docs/auth/extend-with-blocking-functions?gen=2nd. It is a workaround for onCreate callback. Yes, I try it but this trigger not working in emulators ... (or i don't find how to) and i believe acces right is limited (for interact with firestore or other) I any one know a solution for use blocking functions in emulators |
+1 for Python support |
+1 |
2 similar comments
+1 |
+1 |
Will this be implemented at some point?
But they still urge us to upgrade all our functions to v2... |
Yes, please add this. I updated my firebase functions to the latest, now I get firebase.runWith is not a function error. How can you say it co-exists when it cant after you upgrade to the latest version of firebase-functions? +1 |
+1 |
+1, classic half-baked major upgrades by Firebase |
+1 |
To all potential viewers: If you haven’t contacted Firebase to raise your concern yet, please take a moment to do so. It would be helpful if you could specify whether (and how severely) the lack of Firebase Auth Also, please cast a vote at UserVoices: |
@colerogers do you have any updates on this issue? |
When will this get resolved ? Our whole codebase is on v2 just for this one trigger, we need to use v1. |
+1 |
now I was able to deploy gen1 functions with nodejs22 again:-) Not mentioned in the docs, but at least it makes it easier to use the gen1 auth triggers in a gen2 codebase... |
:( |
There's one good news since yesterday... it seems v1 functions will now work on node runtime 22 as well (v1 was limited to node v20 before) i.e. when you have v1 and v2 functions, as most of us do it seems (see above), the deployment becomes easy again... I've all on node 22 now, v1 and v2 functions. The docs still say v1 functions can only run up to node v20 but that's not true anymore. @atsjo can you confirm? Update: gosh, just realized you posted this 'news' 3 weeks ago already... I discovered it just yesterday by accident, not switching my local env back to node 20 for gen1 functions and it f***** worked which at first confused me a lot 🤣 |
bruh yall have to fix this. this is embarrassing |
+1 |
This starts to be a theme, the parameter support is half done, the support for auth triggers is half done the support for custom service account is half done, pretty much everything is only half finished regarding cloud run functions and at the same time Google is moving forward deprecating things and asking everyone to upgrade, well would love to, but can only do it for half of the functions due to these unfinished features. Would be nice to at least know when we can expect full v2 functions support. Yes one can run v1 and v2 at the same time, but who really wants to maintain two different code bases. |
Any official statement from Google, before they deprecate us all to nonexistence? |
Hey guys, friendly reminder that everyone is sad at you. |
+1 |
Oh, it's apparently not yet available. That's why AI answer keep looping.
I wonder using v1 as workaround can still be used 2 years after.. |
For byPass limitation you need to use dedicated oncall or onrequest fn for create , update , delete a user with server auth package and use your logic at this time. The front auth package can only be used for signin or signout. You can too use the signinwithcustomtoken fn in front if you want signin from server. |
Pretty crazy that this is still an issue. I have not seen any replies to any of these posts for so long. Does anyone even work on this stuff? Trying to build something here and we can't really run this stuff anymore. Just stop, why force us to upgrade when you can't even force yourself to maintain your libraries. Only the posters here will get this info because no one at Google could give a crap about our projects and our success. It is garbage and if you worked for any of us we would fire you for incompetence and lack of communication at a minimum. Someone is updated the messages telling us we need to upgrade our node, why not upgrade your stuff at the same time. Act like you are one of the largest companies in the world. Maybe focus on something other than AdWords for a bit. Try it out. You committed to use node, and you know Nodes update cycle. Who dropped the ball here? It takes you longer to update your library than the cycle to deprecate your library. Seems like 101 stuff here. Maybe the interns should not be handing this project anymore. Seriously disappointing, since you are releasing great new features for firebase this same time you are doing nothing for basic triggers like OnCreateUser. Who would need such an edge case method, right? |
Hey folks, just wanted to check if I’m missing something here. I’ve been seeing a lot of complaints about the lack of auth onCreate/onDelete triggers in v2 and how people can't upgrade to v2 because of this, but isn’t it totally fine to just mix v1 and v2 functions? We’ve upgraded all our other triggers (Firestore, callables, etc.) to v2, and we’re still using v1 just for the auth triggers until they’re supported in v2. This setup works fine with both Node.js 20 and 22 engines: import { runWith } from 'firebase-functions/v1';
import { onDocumentCreated } from 'firebase-functions/v2/firestore';
export const authTriggerV1 = runWith({ /* config */ })
.auth.user()
.onCreate(async user => {
// ...
});
export const firestoreTriggerV2 = onDocumentCreated('users/{userId}', async event => {
// ...
}); It’s been working smoothly for us. Once v2 supports auth triggers, we’ll migrate those too. Is there a reason this isn’t a viable solution for others? |
...and for what it is worth, they can no longer run side-by-side with v2 functions - #1653 |
@davie-robertson Did you try deploying yourself? It is working for me. The issue you linked is from December 2024. It is possible they added support recently and haven't updated the docs. ![]() |
hi @kafkas , Yes, I am deploying via |
Layoffs are so good, am I right folks? |
+1 |
+googol |
+1 |
Please add Authentication onCreate and onDelete triggers for v2 functions in the SDK, this is really missing. 🙏
Related issues
#1213
#1381
Version info
firebase-functions:
v4.3.1
firebase-tools:
11.29.0
The text was updated successfully, but these errors were encountered: