tsoa
tsoa copied to clipboard
Hapi authentication callback should include ResponseToolkit (h) object
Sorting
-
I'm submitting a ...
- [ ] bug report
- [x] feature request
- [ ] support request
-
I confirm that I
- [x] used the search to make sure that a similar issue hasn't already been submit
Expected Behavior
hapiAuthentication callback should also receive the hapi.ResponseToolkit (aka h) object.
Current Behavior
hapiAuthentication only gets the Request object
Possible Solution
export async function hapiAuthentication(
request: Request,
h: ResponseToolkit,
securityName: string,
_scopes?: string[],
)
Steps to Reproduce
N/A
Context (Environment)
N/A
Detailed Description
The hapiAuthentication callback should also receive the hapi.ResponseToolkit (aka h). It currently only has access to the hapi.Request object. h is useful for example when trying to avoid the terrible Boom library, with the ability to use Response.takeover(). There are probably other use cases as well
Breaking change?
Yes if implemented as I described above.
Hello there wallacethefmh 👋
Thank you for opening your very first issue in this project.
We will try to get back to you as soon as we can.👀
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days
I'd be open to injecting this on demand
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days
I would be interested in something similar to this for koa responses.