Adonisjs, Nodejs.
Asking in the Adonis.js project discord, I received a hint that I could modify my AuthMiddleware to add extra logic for handling this. Initially I’d totally missed that there even was an AuthMiddleware in my project, it’s located in the app/middleware/auth_middleware.ts file. Once I had that small