Currently, the shape of the user object returned when authenticating is hardcoded into this middleware lib. We should consider instead allowing the consuming modules/apps to specify the shape of the user object they want to receive. Any necessary handling for invalid props or props the authenticated user shouldn't have access to is already handled by the graphql server, so that is taken care of. Should be a pretty safe change to make and will make this lib much more flexible/usable as the user model changes over time.
Currently, the shape of the user object returned when authenticating is hardcoded into this middleware lib. We should consider instead allowing the consuming modules/apps to specify the shape of the user object they want to receive. Any necessary handling for invalid props or props the authenticated user shouldn't have access to is already handled by the graphql server, so that is taken care of. Should be a pretty safe change to make and will make this lib much more flexible/usable as the user model changes over time.