π§βπ» Launch manifest on dev mode without token secret key #241
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR allows to run Manifest on development and contribution mode without specifying a TOKEN_SECRET_KEY in the
.env
file.Why is this important ?
Stackblitz removes the .env files in embed editors (like Manifest playground page). To prevent asking the user to add it manually, I had to change the behavior and set a default secret key if there is no .env file.
However this is a security issue on production. To prevent that we throw an error if the environment is production and the key is not specified
How can it be tested?
packages/core/manifest
TOKEN_SECRET_KEY
inpackages/core/manifest/.env.contribution
. It should work the sameNODE_ENV
toproduction
and remove the key. Thenpm run dev
task should throw an error saying that it can't run without a secret keyImpacted packages
Check the NPM packages that require a new publication or release:
Check list before submitting