-
Notifications
You must be signed in to change notification settings - Fork 124
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(http): add new HttpRequestParser<T> injection token
This allows to fetch arbitrary request data from header, body, and query at the same time in an async fashion. Necessary for reading request data in a 'http' scoped event listener, e.g. onAuth events. ``` type AuthData = { auth: string; userId?: number; } httpWorkflow.onAuth.listen(async (event, session: HttpSession, authParser: HttpRequestParser<AuthData>) => { const auth = await authParser(); session.auth = auth.auth; session.userId = auth.userId; }); ``
- Loading branch information
Showing
4 changed files
with
136 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters