I am having a hard time finding out if I am thinking about things in the best way. I want to know what to do with a user after they have been authenticated through some type of middleware, either BasicAuth
or JWT
.
Should I store all the relevant user fields in the context as a value? If I store them in the context then do I need a special function to pull them out? (which would use a user defined contextKey type to retrieve and convert its type back to the proper struct)
I can come up with something that works, but IDK if it is the most reasonable way to go about it.