Skip to content
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

No response is sent to the client when an exception occurred in Custom Auth Handler. #184

Closed
davuteryilmaz opened this issue Feb 9, 2019 · 1 comment
Labels
accepted Issue has been accepted and inserted in a future milestone

Comments

@davuteryilmaz
Copy link

procedure TCustomAuth.OnAuthentication(const AContext: TWebContext; const UserName: string; const Password: string;
UserRoles: TList<System.string>;
var IsValid: Boolean;
const SessionData: System.Generics.Collections.TDictionary<System.string, System.string>);
begin
{
Here you should do the actual query on database or other "users store" to
check if the user identified by UserName and Password is a valid user.
You have to fill also the UserRoles list with the roles of the user.
Moreover additional user properties can be added in the SessionData dictionary
}
// We defined 3 statc users here: admin, user1, user2
IsValid := False;

I added raise EDivByZero.Create('Division by zero.'); this line to the method above and run the sample app. Could not get any response when post http://localhost:8080/system/users/logged by Postman. The exception is logged but no respone is sent. Is it posible to send HTTP 500 response when an exception raised in the auth handler? Thanks.

@danieleteti
Copy link
Owner

Will be fixed in 3.1.1-beryllium-RC3

@danieleteti danieleteti added this to the 3.1.1 (beryllium) milestone Feb 24, 2019
@danieleteti danieleteti added the accepted Issue has been accepted and inserted in a future milestone label Feb 24, 2019
danieleteti added a commit that referenced this issue Feb 24, 2019
…with the default response content-type (usually it did would reply using `text/plain`).

- Fix! [issue184](#184).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted Issue has been accepted and inserted in a future milestone
Projects
None yet
Development

No branches or pull requests

2 participants