-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot skip required payload authentication with injected credentials #4214
Comments
It's not entirely clear to me either, but from some quick testing, the test suite fails if payload validation is skipped on injected requests 😄 |
@cjihrig Is there any chance to change that and skip payload authentication when credentials are injected? Does it make sense? |
I think the best way to support this without breaking any existing code would be to add a new option to |
Nice, would the following API make sense? options.auth
Usageconst { result } = await server.inject({
method: 'POST',
url: '/test',
auth: {
strategy: 'default',
credentials: {},
payload: false,
},
}); |
That proposal makes sense to me. |
LGTM too. |
Hi @Nargonath @cjihrig I recently created a pull request with these changes at #4274. Have some time to take a look? |
Support plan
Context
What are you trying to achieve or the steps to reproduce?
When trying to inject credentials to an authentication scheme requiring payload authentication, then the payload authentication cannot be skipped.
What was the result you got?
The test fails because payload authentication could not be skipped, while the scheme authentication was.
What result did you expect?
Both the payload authentication and scheme authentication are skipped, when credentials are injected. If we update the authentication scheme to not require payload authentication, the test would pass.
I am not actually sure this is the expected behavior or not, for now I manually skip the payload authentication on my scheme when credentials are injected.
The text was updated successfully, but these errors were encountered: