With regards to the Medusa Eats demo, I'm looking into the security vulnerabilities that could potentially come up with the auth register endpoint. As the endpoint stands, it is setup to register and authenticate a new session which we later tie to either a restaurant admin or driver. With the existing logic, we are potentially allow for drivers to access data the they shouldn't access, such as listing all drivers (we potentially wouldn't want drivers to see other drivers info).
But more concerning, a malicious user could potentially register a new auth and then create a driver. Technically shouldn't we limit the creation of a driver or restaurant admin to a user admin only?
Also note, I do understand that this is a recipe so the answer might be that this was done so intentionally for the purpose of the demo 😇
Thanks again - I ask to better understand best practices when it comes to using auth for creating different types of users.