Skip to content

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 that ctx.user is defined
  • isAdmin: We need to get the user object here. There is a boolean property called admin on the user.