feat: admin notifications for org sign up#1768
feat: admin notifications for org sign up#1768aaerhart wants to merge 3 commits intocodeforboston:mainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
@Mephistic Realizing there might be the new In the readme under |
In this PR, it looks like a second firebase function is still being defined in See We talked about extracting out the common admin sending so there's some shared function: that is used by a firestore trigger function (like above) and an https function (like): The HTTPS function may be unnecessary - you can test firebase function directly from an emulator with |
Yeah, agreed that doesn't sound like an issue defining the function - just an auth issue. I confirmed that you have access to the dev project. When you open a new shell tab/window, can you confirm:
If the above look as we'd expect, one thing that works sometimes is forcing a firebase auth refresh with |
Yeah, the firebase login --reauth did indeed log me in, thanks for the pointer. I do have the application_default_credentials.json file with account, client_d, client_secret, quota_prooject_id, refresh_token, type, and universe_domain. The GOOGLE_APPLICATION_CREDENTIALS variable has been confirmed as having the path for that json file as its value. |
I'm getting when I run |
|
Based on that error, it sounds like you should just need to install Java and make sure it's in your $PATH to make things work. |
kiminkim724
left a comment
There was a problem hiding this comment.
Once we merge the fixes for profile creation, we should address these issues
| const before = snapshot.before.data() as ProfileData | ||
| const after = snapshot.after.data() as ProfileData | ||
|
|
||
| if (before.role === "rolePending") { |
There was a problem hiding this comment.
If the profile hasn't been created yet, before will be undefined and the function will throw an error.
| if (!snapshot.after.exists) { | ||
| console.error("New snapshot does not exist") | ||
| return | ||
| } |
There was a problem hiding this comment.
This should happen before we make any calls to after?
| if (!snapshot.exists) { | ||
| console.error("New snapshot does not exist") | ||
| return | ||
| } |
| if (!snapshot.exists) { | ||
| console.error("New snapshot does not exist") | ||
| return |
Summary
Adding functions for notifications emails to users and admins. This draft in particular is just testing if organization sign up emails are added to the emails collection. See adminNotification function and its call in the onRequest.
Checklist
Screenshots
Known issues
Steps to test/reproduce