@AlexSwe Are you open to adding more middleware names?
I wish there were additional middlewares in addition to: before.handler, handler, and after.handler
Here is the order of when middleware and handlers are currently called:
HOOK - before.handler
NEW_USER
NEW_SESSION
ON_REQUEST
LAUNCH
HOOK - handler
HOOK - after.handler
Here is my proposal with additional middlewares: new.user, new.session, and on.request each with a before and after option:
HOOK - before.handler
HOOK - before.new.user
NEW_USER
HOOK - new.user
HOOK - after.new.user
HOOK - before.new.session
NEW_SESSION
HOOK - new.session
HOOK - after.new.session
HOOK - before.on.request
ON_REQUEST
HOOK - on.request
HOOK - after.on.request
LAUNCH
HOOK - handler
HOOK - after.handler
My scenario is that for a launch, I want to use the initial values set in NEW_USER but plug into HOOK:new.user so I can modify some values. This is helping me with unit testing as the hook is only added during unit testing.
I can see these additional hook middlewares being useful to others.
Thanks,
Mark