Skip to content

Fix Firebase example and throw meaningful errors#3351

Closed
penx wants to merge 1 commit intoremix-run:mainfrom
penx:fix-firebase-example
Closed

Fix Firebase example and throw meaningful errors#3351
penx wants to merge 1 commit intoremix-run:mainfrom
penx:fix-firebase-example

Conversation

@penx
Copy link
Contributor

@penx penx commented Jun 1, 2022

Apply fixes as per comment by @mocon at #1811 (comment)

Also:

  • throw meaningul errors when environment variables are missing or can't be parsed.
  • check for existence of environment variable rather than cast to string

Closes: issue reported in comment #1811 (comment)

  • Docs N/A
  • Tests N/A

Testing Strategy:

cd examples/firebase-auth-firestore
yarn
yarn dev
# open http://localhost:3000
# assert "Error: Missing CLIENT_CONFIG environment variable" thrown as env variables are missing
# exit ^C
cp .env.example .env
yarn dev
# open http://localhost:3000
# assert "Error: Failed to parse private key" thrown as example env does not contain valid keys
# exit ^C
# manually edit .env and set invalid keys
yarn dev
# open http://localhost:3000
# assert "Error: Invalid CLIENT_CONFIG environment variable"
# exit ^C
# manually edit .env and set valid keys
yarn dev
# open http://localhost:3000
# assert login page loads

Apply fixes as per comment by @mocon at remix-run#1811 (comment)

Also:

- throw meaningul errors when environment variables are missing or can't be parsed.
- check for existence of environment variable rather than cast to string
@penx
Copy link
Contributor Author

penx commented Jun 1, 2022

closing as should be against dev branch

@penx penx closed this Jun 1, 2022
@MichaelDeBoey MichaelDeBoey added the duplicate This issue or pull request already exists label Jun 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

duplicate This issue or pull request already exists

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants