-
-
Notifications
You must be signed in to change notification settings - Fork 413
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
Unexpected Auth interaction #1494
Comments
I think I found the problem. It's the I think the 401 should be thrown immediately if the EDIT: Thinking about it a bit more, would it make more sense to change the |
This reminds me of the |
I have noticed a peculiar interaction with using the
Auth
API part. Even when you use aReqBody
afterwards in that same endpoint, theAuth
handling will be done AFTER theReqBody
has been parsed/transformed. i.e.:In this case, even when the JWT fails to verify or when the header isn't even present, the endpoint will FIRST reply with 400 BAD CONTENT responses until the JSON is parsed correctly, and THEN the 401 UNAUTHORIZED I throw when the result of
AuthResult
is notAuthenticated
.Is this the expected behaviour? Because from a security perspective, I would like to not leak my data format to any person that knows (or stumbles upon) my endpoints.
I would expect that it might work that way when you define
ReqBody :> Auth
, but even then I'd prefer the Auth to be checked first.The text was updated successfully, but these errors were encountered: