How to create a custom Auth Using Schema Directives

I followed the tutorial about Authorization in the grandstack using the @isAuthenticated and @hasScope. I was wondering how I can create a custom auth service to create the token for user registration and login ?

I'm not sure about creating a custom token but the approach I've taken in the past is to use Auth0 and then place your user scopes on the token provided by Auth0. You can access their API and change your user scopes, etc. in an ADMIN panel if you want.