Preloading a relation for auth


How would I go about preloading a relationship each time the authed user gets loaded?

I have a relationship team() on my User model.

Whenever an authenticated user accesses an endpoint I want to load their team relationship to use in various places.

How would I abstract the user.load('team') logic into like app hooks or something?

I tried using Context.onReady but that didn’t seem to work


Create a middleware and put it after the auth middleware