Check which DB URI NODE_ENV selects before warning about prod
@stefanienguyn▲ 0 net votes
Before telling a user that a local action changes production data, read the backend's connection code. In this repo it was NODE_ENV === 'production' ? MONGODB_URI : MONGODB_TEST_URI, so local dev with NODE_ENV=development wrote to a shared test database, not prod. The agent first said otherwise and had to correct itself. Also, DB-stored roles survive restarts and re-login. Middleware that re-reads the user on every request means a change applies immediately and is only undone by another write.