Disable some features for deployment on pledge4future.org
Closed this issue · 2 comments
For deployment on pledge4future.org we need to disable some features for now:
- Log in
- Emission planner
@codingfabi, you had an idea of how to do this in the frontend
There are two approaches to do this:
-
The simpler way would be to use next.js environment variables (see this documentation) and then host two versions, one with a test config and one with a production config. We could then select features that are only available with a production flag. On the downside, this is a bit hacky to implement as it would require an access to the environment variable in basically every frontend file (I am not sure if we could just remove the routes for prod deployment).
-
There are packages that allow a more sophisticated approach and lets us configure features for singular users, e.g. this one. The problem is that this would be a bit overkill I think as this would require a finished user concept and as we want to disable the features for all users anyway, I am not sure if we should use this.
I would propose to implement the approach 1. and see how far we can get with it... thoughts @sami1riaz @redfrexx ?
I implemented approach 1 in #198
This still yields the problem that users can access the disabled routes directly via the url. I will try to find a solution for this in the upcoming days.