Skip to content
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

Represent Organizer in the DB #66

Open
ryanrightmer opened this issue Sep 24, 2020 · 1 comment
Open

Represent Organizer in the DB #66

ryanrightmer opened this issue Sep 24, 2020 · 1 comment
Assignees

Comments

@ryanrightmer
Copy link
Collaborator

ryanrightmer commented Sep 24, 2020

Organizers need to be tied to a property

Needs to hold basic contact information
Represent ID as a string ( we will hold their firebase auth id here eventually )

@JamesBock
Copy link
Collaborator

I think the most straight forward way we can do this is with Cloud Functions. Firebase Auth triggers

Firebase accounts will trigger user creation events for Cloud Functions when:

  • A user creates an email account and password.
  • A user signs in for the first time using a federated identity provider.
  • The developer creates an account using the Firebase Admin SDK.
  • A user signs in to a new anonymous auth session for the first time.

When a user is created with Firebase Auth, the Cloud Function will be triggered to send a PUT to the db to create a Organizer entity.

The Cloud Function is passed a UserRecord that has the uid of the created User, so we can use that to identify the db entity and assign Properties to it.

In the future, I hope we can selectively create db entries based on the Claims of the User, so when a User is created with whatever Claims a Organizer has, an Organizer is created in the db. Athough, this calls into question when and how the Claims are assigned. I think the only Users at this time are the Organizers so I don't think is a pressing issue for the MVP.

@JamesBock JamesBock self-assigned this Oct 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants