Easier mock login
Currently one needs to fill out a handful of fields in the mock login form (used in dev and staging environments). While it’s great that the user can be customized, it’s annoying that it also has to be customized before every single login. We could make logins after the initial one easier in several ways:
- Provide some preconfigured users (e.g.
stud01,teach1,admin1), with one-click login possibility. This is the easiest to use, and it requires no backend changes (the frontend can do as if the user filled the form), but it’s limited to the predefined set of users; if I want to test with a user that’s student and teacher at the same time, I need to fill out the current form. - Provide a different form that contains a single input field for the user name (or add a checkbox to the current form that disables the rest of the fields), and add a new endpoint on the backend that accepts only a user name. The current endpoint cannot be used, as not providing any data beyond the user name means that everything else is nulled out, including the fact that the user would have no permissions. The new endpoint also needs to check whether the provided user exists, as otherwise, again, all other data is effectively nulled out.
- Provide a list of all existing users, which allows the user to log in with a single click. It’s almost as convenient as the first option (the user needs to scan through a potentially longer list, which is a bit less convenient), while as versatile as the second one. However, it requires two new endpoints: the same as for the second option, and another one that lists existing users (this should also be limited to dev/staging environment, as getting a list of all users in production environment without logging in doesn’t seem like a good idea security-wise).
My personal favorite is the second option, but any one of them would definitely be an improvement compared to the current situation.