Auth helper functions
Let's add a couple of generic helper rules to our auth middleware and export them along with the rest of the shield items.
-
isAuthenticated: basically check thatctx.useris defined -
isAdmin: We need to get the user object here. There is a boolean property calledadminon the user.