eastlakehs / community-service-tracker

Repo for the eastlake community service tracker website.
https://ehs-service.org
MIT License
4 stars 1 forks source link

Improve Developer Workflow: Stubbing authentication #175

Open daniel-sudz opened 3 years ago

daniel-sudz commented 3 years ago

Is your feature request related to a problem? Please describe. So people should be able to work on admin features, but shouldn't be able to wreck the production database. So we need to stub the database in development.

This is now supported: https://github.com/firebase/firebase-tools/issues/1677#issuecomment-717364427

https://firebase.google.com/docs/emulator-suite/connect_auth https://firebase.google.com/docs/emulator-suite/install_and_configure

We can import a mock database like so: https://stackoverflow.com/a/62977147

Although, generating the initial state and exporting it to a valid blob format has to be done manually.

daniel-sudz commented 3 years ago

in progress

theTisch21 commented 3 years ago

Is there an environment variable in netlify, like "NODE_ENV=Production"? If so, we could have our code check for that, and if it's set to "Production", to use firebase authentication like usual, but if it's set to "development", to deny access to the production database and instead use the emulator.

theTisch21 commented 3 years ago

This will be a lot easier once we update firebase #107