You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On new requiest an event request fired. This allows to capture request state and deserialize access tokens, session from cookies, etc.
On just before the body would be sent, event before-response fired with request and response refs, to serialize security claims into cookies if necessary.
It is important to schedule for request event handlers like
[interceptSession,rebuildClaims]
while on the before-response the event handlers must be run in opposite order:
[serializeClaims,packSession]
But with current API I can not directly express this with Emittery.
So, I would like to see either
in my case I can wrap event handlers registration and postpone actual on calls, until the building of web application will be completed.
But async match of EventEmitter.prependListener and EventEmitter.prependOnceListener may be helpful in some other cases when delayed listeners construction is not possible.
The text was updated successfully, but these errors were encountered:
Usage case:
request
fired. This allows to capture request state and deserialize access tokens, session from cookies, etc.before-response
fired with request and response refs, to serialize security claims into cookies if necessary.It is important to schedule for
request
event handlers likewhile on the
before-response
the event handlers must be run in opposite order:But with current API I can not directly express this with
Emittery
.So, I would like to see either
in an Emittery instance, or some flag like:
in my case I can wrap event handlers registration and postpone actual
on
calls, until the building of web application will be completed.But async match of
EventEmitter.prependListener
andEventEmitter.prependOnceListener
may be helpful in some other cases when delayed listeners construction is not possible.The text was updated successfully, but these errors were encountered: