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

Check for Environment Variables before use #36

Open
burtonr opened this issue Oct 16, 2022 · 0 comments
Open

Check for Environment Variables before use #36

burtonr opened this issue Oct 16, 2022 · 0 comments
Labels
Server (Node/Express) An issue only on the server side

Comments

@burtonr
Copy link
Owner

burtonr commented Oct 16, 2022

When authentication is enabled (the default behavior), but the API_KEY environment variable is not set, the app crashes from an Error thrown by the jsonwebtoken library.

Need to check the existence of the environment variables to avoid unexpected errors.

Probably a startup check so the problem is known as soon as possible. Perhaps add a warning to the /settings response. This way the UI could get updated to show the message on load.

MONGO_URI is required. The app cannot function without it.
API_KEY is only needed if DISABLE_AUTH is not true
PORT is not required

@burtonr burtonr added the Server (Node/Express) An issue only on the server side label Oct 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Server (Node/Express) An issue only on the server side
Projects
None yet
Development

No branches or pull requests

1 participant