brewhops / api

API for the brewhops fermentation tracking system
https://brewhops-api.now.sh
0 stars 0 forks source link

determine and implement best way to associate users with their organization's client_id #10

Open danvanhorn opened 5 years ago

danvanhorn commented 5 years ago

This is important, as it will determine now much we need to change the front end to associate the new client_id feature. We should have the means to associate an employee with their corresponding client_id in the back end. My and Brennan's first inclination is middleware that creates an employee object and passes it along with each request. We could extend the Express.Request object in typescript in order to make this cleaner. We should figure out the best and most secure way to do this because it will effect how much we change the front-end app.

brennand97 commented 5 years ago

Some work on this is already on the feat/client-table. The client_id has been included in the auth token already. Middleware to turn this into an employee has yet to be done though. Though since we already have a secure client_id I'm not sure we need the employee object on every request. We could just get it when needed now.